|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jmonks.batch.io.RecordSpec
org.jmonks.batch.io.flat.FixedWidthFlatFileRecordSpec
FixedWidthFlatFileRecordSpec represents record-spec element in the file spec
belongs to the fixed width flat file type. Along with the record-type
attribute
it looks for the starts-with
and record-length
attributes
in the record-spec element to identify the record. starts-with
tells
the value that the record starts with and record-length
tells the
length of the record. Record type and starts-with attribute values
should be unique across the file-spec. Here is a sample spec snippet...
<file-spec file-type="fixed-width-flat"> <record-spec record-type="detail" starts-with="5" record-length="42"> <!-- field specs will follow here --> </record-spec> </file-spec>
Field Summary | |
static java.lang.String |
RECORD_LENGTH_ATTRIB_NAME
Constant defines the record length attribute name. |
protected int |
recordLength
Holds the length of the record. |
static java.lang.String |
STARTS_WITH_ATTRIB_NAME
Constant defines the starts with attribute name. |
protected java.lang.String |
startsWith
Holds the record specs starts with attribute value. |
Fields inherited from class org.jmonks.batch.io.RecordSpec |
fieldSpecList, RECORD_SPEC_TAG_NAME, RECORD_TYPE_ATTRIB_NAME, recordType |
Constructor Summary | |
protected |
FixedWidthFlatFileRecordSpec(RecordType recordType)
Constructs the record spec by accepting the record type. |
Method Summary | |
static FixedWidthFlatFileRecordSpec |
createFixedWidthFlatFileRecordSpec(org.w3c.dom.Element recordSpecElement)
Factory method to create the fixed width flat record spec from the given DOM Element representing the record-spec element in the file spec. |
int |
getRecordLength()
Gets the length of the record. |
java.lang.String |
getStartsWith()
Gets the starts-with value of this record. |
boolean |
isMatch(java.lang.String recordString)
Tells whether the given record matches with the record spec. |
java.lang.String |
toString()
|
Methods inherited from class org.jmonks.batch.io.RecordSpec |
addFieldSpec, getFieldSpecs, getRecordType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected java.lang.String startsWith
protected int recordLength
public static final java.lang.String STARTS_WITH_ATTRIB_NAME
public static final java.lang.String RECORD_LENGTH_ATTRIB_NAME
Constructor Detail |
protected FixedWidthFlatFileRecordSpec(RecordType recordType)
Method Detail |
public java.lang.String getStartsWith()
public int getRecordLength()
public boolean isMatch(java.lang.String recordString)
recordString
- Record read from the file.
public static FixedWidthFlatFileRecordSpec createFixedWidthFlatFileRecordSpec(org.w3c.dom.Element recordSpecElement)
recordSpecElement
- DOM Element representing the record spec.
FileSpecException
- If record-spec
doesnt have the starts-with or record-type attribute.public java.lang.String toString()
Object.toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |