org.jmonks.batch.io.xml
Class XMLFileSpec

java.lang.Object
  extended byorg.jmonks.batch.io.FileSpec
      extended byorg.jmonks.batch.io.xml.XMLFileSpec

public class XMLFileSpec
extends FileSpec

XMLFileSpec represents the file spec defines the xml file where each different kind of record identified by the xpath. This file-spec requires additional attribute root-element which specifies root element of the xml file along with the file-type attribute, which is supposed to be "xml". Here is a sample file spec...

      <file-spec file-type="xml" root-element="consumer-request">
          <!-- record specs will follow here -->
      </file-spec>
  

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Field Summary
protected  java.lang.String encoding
          Holds the encoding value to be placed in processing instruction.
static java.lang.String ENCODING_ATTRIB_NAME
          Constant defines the encoding attribute name.
static java.lang.String ROOT_ELEMENT_ATTRIB_NAME
          Constant defines the root element attribute name.
protected  java.lang.String rootElement
          Holds the root element.
static java.lang.String XML_INDENTATION_ENGINE_ATTRIB_NAME
          Constant defines the xml indentation engine attribute name.
protected  java.lang.String xmlIndentationEngineClassName
          Holds the class name of XMLIndentationEngine.
 
Fields inherited from class org.jmonks.batch.io.FileSpec
FILE_SPEC_TAG_NAME, FILE_TYPE_ATTRIB_NAME, fileType, recordSpecMap
 
Constructor Summary
protected XMLFileSpec()
          Constructs the XMLFileSpec instance.
 
Method Summary
static FileSpec createXMLFileSpec(org.w3c.dom.Element fileSpecElement)
          Factory method to create the xml file spec object from the given DOM Element representing the file-spec element.
 java.lang.String getEncoding()
          Get the encoding value to be placed in processing instruction.
 java.lang.String getRootElement()
          Gets the root element.
 java.lang.String getXMLIndentationEngineClassName()
          Returns the XMLIndentationEngine class name to be used to format the output.
 java.lang.String toString()
           
 
Methods inherited from class org.jmonks.batch.io.FileSpec
addRecordSpec, createFileSpec, getFileType, getRecordSpec, getRecordSpecs, isValidRecordType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

rootElement

protected java.lang.String rootElement
Holds the root element.


xmlIndentationEngineClassName

protected java.lang.String xmlIndentationEngineClassName
Holds the class name of XMLIndentationEngine.


encoding

protected java.lang.String encoding
Holds the encoding value to be placed in processing instruction.


ROOT_ELEMENT_ATTRIB_NAME

public static final java.lang.String ROOT_ELEMENT_ATTRIB_NAME
Constant defines the root element attribute name.

See Also:
Constant Field Values

XML_INDENTATION_ENGINE_ATTRIB_NAME

public static final java.lang.String XML_INDENTATION_ENGINE_ATTRIB_NAME
Constant defines the xml indentation engine attribute name.

See Also:
Constant Field Values

ENCODING_ATTRIB_NAME

public static final java.lang.String ENCODING_ATTRIB_NAME
Constant defines the encoding attribute name.

See Also:
Constant Field Values
Constructor Detail

XMLFileSpec

protected XMLFileSpec()
Constructs the XMLFileSpec instance.

Method Detail

getRootElement

public java.lang.String getRootElement()
Gets the root element.


getXMLIndentationEngineClassName

public java.lang.String getXMLIndentationEngineClassName()
Returns the XMLIndentationEngine class name to be used to format the output. This is optional in configuration. If none is specified default xml indentation engine will be used.

Returns:
Returns the class name of XMLIndentationEngine, null if not configured.

getEncoding

public java.lang.String getEncoding()
Get the encoding value to be placed in processing instruction. This will be conifgured in file spec.

Returns:
Returns the file spec.

createXMLFileSpec

public static FileSpec createXMLFileSpec(org.w3c.dom.Element fileSpecElement)
Factory method to create the xml file spec object from the given DOM Element representing the file-spec element.

Parameters:
fileSpecElement - DOM Element representing the file-spec element.
Returns:
Returns the instance of XMLFileSpec.
Throws:
FileSpecException - If two record specs has the same value for the record-xpath and record-type attributes.

toString

public java.lang.String toString()