|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.northconcepts.datapipeline.core.DataEndpoint
com.northconcepts.datapipeline.core.DataReader
com.northconcepts.datapipeline.xml.XmlReader
public class XmlReader
Obtains records from an XML stream. See the Read an XML file example.
XmlReader's addField(String, String), addField(String, String, boolean), and addRecordBreak(String) methods use a
subset of the XPath 1.0 location paths notation to
identify field values and demarcate records.
Axis Specifiers
Axis Abbreviated Syntax Supported Examples ancestor ancestor-or-self attribute @ yes @lang or attribute::lang child yes title or child::title descendant yes descendant-or-self // yes //book or /descendant-or-self::book/ following following-sibling namespace parent .. preceding preceding-sibling self . yes
Node Tests
Predicates
Functions and Operators
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
DataEndpoint.State |
| Field Summary | |
|---|---|
protected Record |
currentRecord
|
protected List<XmlField> |
fields
|
protected File |
file
|
protected XmlNodeReader |
reader
|
protected List<XmlRecordBreak> |
recordBreaks
|
| Fields inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
BUFFER_SIZE, log |
| Constructor Summary | |
|---|---|
XmlReader(File file)
|
|
XmlReader(Reader reader)
|
|
XmlReader(XmlNodeReader reader)
|
|
XmlReader(javax.xml.stream.XMLStreamReader streamReader)
|
|
| Method Summary | |
|---|---|
DataException |
addExceptionProperties(DataException exception)
Adds this endpoint's current state to a DataException. |
XmlReader |
addField(String name,
String locationPathAsString)
|
XmlReader |
addField(String name,
String locationPathAsString,
boolean cascadeValues)
|
XmlReader |
addField(XmlField field)
|
XmlReader |
addRecordBreak(String locationPathAsString)
|
void |
close()
Indicates that this endpoint has finished reading or writing. |
protected void |
createRecord()
|
protected void |
getFieldValues(XmlNode node)
|
protected boolean |
isRecordBreak(XmlNode node)
|
void |
open()
Makes this endpoint ready for reading or writing. |
protected Record |
readImpl()
Overridden by subclasses to read the next record from this DataReader. |
| Methods inherited from class com.northconcepts.datapipeline.core.DataReader |
|---|
available, getBufferSize, getNestedReader, getRootReader, peek, pop, push, read, skip |
| Methods inherited from class com.northconcepts.datapipeline.core.DataEndpoint |
|---|
assertNotOpened, assertOpened, decrementRecordCount, exception, exception, exception, finalize, getDescription, getRecordCount, getRecordCountAsBigInteger, getRecordCountAsString, getState, incrementRecordCount, isClosed, isOpen, isRecordCountBigInteger, resetRecordCount, setDescription, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final List<XmlRecordBreak> recordBreaks
protected final List<XmlField> fields
protected final XmlNodeReader reader
protected final File file
protected Record currentRecord
| Constructor Detail |
|---|
public XmlReader(File file)
public XmlReader(Reader reader)
public XmlReader(javax.xml.stream.XMLStreamReader streamReader)
public XmlReader(XmlNodeReader reader)
| Method Detail |
|---|
public XmlReader addRecordBreak(String locationPathAsString)
public XmlReader addField(XmlField field)
public XmlReader addField(String name,
String locationPathAsString,
boolean cascadeValues)
public XmlReader addField(String name,
String locationPathAsString)
protected void createRecord()
protected Record readImpl()
throws Throwable
DataReaderDataReader.
If no record is available, null will be returned.
readImpl in class DataReaderThrowableprotected void getFieldValues(XmlNode node)
protected boolean isRecordBreak(XmlNode node)
public void open()
throws DataException
DataEndpoint
open in class DataEndpointDataException
public void close()
throws DataException
DataEndpoint
close in class DataEndpointDataExceptionpublic DataException addExceptionProperties(DataException exception)
DataEndpointDataException. Since this method is called whenever an
exception is thrown, subclasses should override it to add their specific information.
addExceptionProperties in class DataReader
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||