org.jmonks.batch.io.flat
Class DelimitedFlatFileFieldSpec

java.lang.Object
  extended byorg.jmonks.batch.io.FieldSpec
      extended byorg.jmonks.batch.io.flat.DelimitedFlatFileFieldSpec

public class DelimitedFlatFileFieldSpec
extends FieldSpec

DelimitedFlatFileFieldSpec represents field-spec element in the record spec element belongs to the delimited flat file type. Along with the field-name attribute it looks for the index attribute in the field-spec element to retrieve the field from the record. It specifies the field position in the record. Field index value starts with 1. Filed name on field-spec should be unique across the record-spec. Here is a sample spec snippet...

      <file-spec file-type="delimited-flat">
          <record-spec record-type="detail" delimiter="|">
              <field-spec field-name="consumer-id" index="1"/>    
              <field-spec field-name="consumer-name" index="2"/>    
          </record-spec>
      </file-spec>
  

Since:
1.0
Version:
1.0
Author:
Suresh Pragada

Field Summary
static java.lang.String INDEX_ATTRIB_NAME
          Constant defines the index attribute name which is "index"
 
Fields inherited from class org.jmonks.batch.io.FieldSpec
FIELD_NAME_ATTRIB_NAME, FIELD_SPEC_TAG_NAME, fieldName
 
Constructor Summary
protected DelimitedFlatFileFieldSpec(java.lang.String fieldName)
          Creates a new instance of DelimitedFlatFileFieldSpec by using field name.
 
Method Summary
static DelimitedFlatFileFieldSpec createDelimitedFlatFileFieldSpec(org.w3c.dom.Element fieldSpecElement)
          Factory method to create the DelimitedFlatFileFieldSpec instance from the given DOM Element representing the filed-spec element in record spec.
 int getIndex()
          Returns the index of field in the record.
 java.lang.String toString()
           
 
Methods inherited from class org.jmonks.batch.io.FieldSpec
getFieldName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INDEX_ATTRIB_NAME

public static final java.lang.String INDEX_ATTRIB_NAME
Constant defines the index attribute name which is "index"

See Also:
Constant Field Values
Constructor Detail

DelimitedFlatFileFieldSpec

protected DelimitedFlatFileFieldSpec(java.lang.String fieldName)
Creates a new instance of DelimitedFlatFileFieldSpec by using field name.

Method Detail

getIndex

public int getIndex()
Returns the index of field in the record. Index value starts with 1.


createDelimitedFlatFileFieldSpec

public static DelimitedFlatFileFieldSpec createDelimitedFlatFileFieldSpec(org.w3c.dom.Element fieldSpecElement)
Factory method to create the DelimitedFlatFileFieldSpec instance from the given DOM Element representing the filed-spec element in record spec.

Parameters:
fieldSpecElement - DOM Element representing the field-spec element.
Returns:
Returns the DelimitedFlatFileFieldSpec instance.
Throws:
FileSpecException - If field-spec field-name values are not unique across record-spec and it is missing index attribute.

toString

public java.lang.String toString()
See Also:
Object.toString()