|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmonks.batch.io.FileReader
org.jmonks.batch.io.xml.XMLFileReader
XMLFileReader reads the specified xml file according to the given file spec and returns the recrods on the needed basis. It finds the record location using the xpath given in each xml record spec and loads all the child elements as a fields. Field values should be accessed using the element names. If element is a complex element, returned value will be a reader record and it again follow the same convention. If element is repeated more than once, the value will be loaded as a list. ReaderRecord returned by this reader will have additional methods used to read the data accurately. To find out how to read each record from the file and to read the each field from the record, refer to the package javadoc.
Nested Class Summary | |
class |
XMLFileReader.XMLReaderRecord
XMLReaderRecord implements ReaderRecord by maintaing the field names and values as a map and provides the methods with proper access privileges to read into and write from the record. |
Field Summary | |
protected XMLFileSpec |
fileSpec
File spec to read the file. |
Constructor Summary | |
XMLFileReader(java.io.InputStream fileInputStream,
FileSpec fileSpec)
Constructs and initializes the XML File reader. |
|
XMLFileReader(java.io.Reader reader,
FileSpec fileSpec)
Constructs and initializes the XML File reader. |
Method Summary | |
void |
close()
Closes the reader. |
ReaderRecord |
getNextRecord()
Gets the next available record from the file. |
Methods inherited from class org.jmonks.batch.io.FileReader |
getFileReader, getFileReader, getFileReader, getFileReader |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected XMLFileSpec fileSpec
Constructor Detail |
public XMLFileReader(java.io.InputStream fileInputStream, FileSpec fileSpec)
fileInputStream
- Input stream to the file.fileSpec
- File spec to be used to read the file.
FileParseException
- If root element doesnt match
with the element specified in file spec and problems to initializes the reader.public XMLFileReader(java.io.Reader reader, FileSpec fileSpec)
reader
- Reader to the file.fileSpec
- File spec to be used to read the file.
FileParseException
- If root element doesnt match
with the element specified in file spec and problems to initializes the reader.Method Detail |
public ReaderRecord getNextRecord()
getNextRecord
in class FileReader
FileParseException
- Problems getting the next record.public void close()
close
in class FileReader
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |