Class FixedWidthField
java.lang.Object
com.northconcepts.datapipeline.fixedwidth.FixedWidthField
- All Implemented Interfaces:
JsonSerializable,RecordSerializable,XmlSerializable
Describes one column (name, width, alignment and fill character) of the records handled by
FixedWidthReader
and FixedWidthWriter.-
Field Summary
Fields inherited from interface com.northconcepts.datapipeline.core.RecordSerializable
SERIALIZED_CLASS_NAME, TYPEFields inherited from interface com.northconcepts.datapipeline.core.XmlSerializable
XML_SERIALIZED_CLASS_NAME -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfromRecord(Record source) Loads this instance's state from a record and returnsthis(for fluid API call chaining).fromXmlElement(Element element) getAlign()Returns the side this column's value is aligned to (defaults to LEFT); the fill character goes on the other side.Returns this column's fill character or null to use the reader's or writer's own (a space by default).getName()intgetWidth()booleanisSkip()Indicates ifFixedWidthReaderdiscards this column instead of creating a field for it (default is false).setAlign(FixedWidthAlign align) Sets the side this column's value is aligned to (defaults to LEFT); the fill character goes on the other side.setFillChar(Character fillChar) Sets this column's fill character or null to use the reader's or writer's own (a space by default).setSkip(boolean skip) Indicates ifFixedWidthReaderdiscards this column instead of creating a field for it (default is false).setWidth(int width) toRecord()Converts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.toString()toXmlElement(Document document) Returns an element, created withdocument, describing this object; the default implementation throws aDataException.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Constructor Details
-
FixedWidthField
public FixedWidthField()
-
-
Method Details
-
getName
-
setName
-
isSkip
public boolean isSkip()Indicates ifFixedWidthReaderdiscards this column instead of creating a field for it (default is false). -
setSkip
Indicates ifFixedWidthReaderdiscards this column instead of creating a field for it (default is false). -
getWidth
public int getWidth() -
setWidth
-
setFillChar
Sets this column's fill character or null to use the reader's or writer's own (a space by default). -
getFillChar
Returns this column's fill character or null to use the reader's or writer's own (a space by default). -
getAlign
Returns the side this column's value is aligned to (defaults to LEFT); the fill character goes on the other side. -
setAlign
Sets the side this column's value is aligned to (defaults to LEFT); the fill character goes on the other side. -
toString
-
toRecord
Description copied from interface:RecordSerializableConverts this object's state to a record thatRecordSerializable.fromRecord(Record)can load.- Specified by:
toRecordin interfaceRecordSerializable
-
fromRecord
Description copied from interface:RecordSerializableLoads this instance's state from a record and returnsthis(for fluid API call chaining). For fluid API call chaining, the overridden method should change the declared return type to its class.- Specified by:
fromRecordin interfaceRecordSerializable- Parameters:
source-- Returns:
- this instance.
-
toXmlElement
Description copied from interface:XmlSerializableReturns an element, created withdocument, describing this object; the default implementation throws aDataException.- Specified by:
toXmlElementin interfaceXmlSerializable
-
fromXmlElement
- Specified by:
fromXmlElementin interfaceXmlSerializable
-