org.jmonks.batch.io.xml
Class XMLFileWriter.XMLWriterRecord

java.lang.Object
  extended byorg.jmonks.batch.io.Record
      extended byorg.jmonks.batch.io.WriterRecord
          extended byorg.jmonks.batch.io.xml.XMLFileWriter.XMLWriterRecord
Enclosing class:
XMLFileWriter

public class XMLFileWriter.XMLWriterRecord
extends WriterRecord

XMLWriterRecord implements WriterRecord 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. It provides the additional method to conveniently write the data into the record.

Author:
Suresh Pragada

Method Summary
 WriterRecord createComplexElement()
          Creates an orphan record that can be added to the record or repeated element later.
 WriterRecord createComplexElement(java.lang.String fieldName)
          Create complex element and add it to the record and returns the writer record instance to which all the elements can be adde.
 java.util.List createRepeatElement(java.lang.String fieldName)
          Creates the list and add it to the record with the given field name and returns the list to which values can be added.
 void writeField(java.lang.String fieldName, java.lang.Object fieldValue)
          Writes the given field name and value into the record.
 void writeSimpleElement(java.lang.String fieldName, java.lang.String fieldValue)
          Write simple element into the record.
 
Methods inherited from class org.jmonks.batch.io.Record
getRecordType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

writeField

public void writeField(java.lang.String fieldName,
                       java.lang.Object fieldValue)
Writes the given field name and value into the record.

Specified by:
writeField in class WriterRecord
Parameters:
fieldName - Name of the field.
fieldValue - Value of the field.

writeSimpleElement

public void writeSimpleElement(java.lang.String fieldName,
                               java.lang.String fieldValue)
Write simple element into the record.


createComplexElement

public WriterRecord createComplexElement(java.lang.String fieldName)
Create complex element and add it to the record and returns the writer record instance to which all the elements can be adde.


createComplexElement

public WriterRecord createComplexElement()
Creates an orphan record that can be added to the record or repeated element later. Once you are done working with this record, you should add this one to either the list or any another element, but you can not submit to the writer for writing this (orphan) record into the file. This will not be associated to any record by default.

Returns:
Returns an XMLWriterRecord.

createRepeatElement

public java.util.List createRepeatElement(java.lang.String fieldName)
Creates the list and add it to the record with the given field name and returns the list to which values can be added.

Parameters:
fieldName - Name of the field repated more than once.
Returns:
Returns the list.