co.uk.hjcs.canyon.parsing
Class DelimitedFieldFlatFileProcessor
java.lang.Object
co.uk.hjcs.canyon.parsing.DelimitedFieldFlatFileProcessor
- All Implemented Interfaces:
- FlatFileProcessor
public class DelimitedFieldFlatFileProcessor
- extends java.lang.Object
- implements FlatFileProcessor
This class is responsible for the reading and creation of delimited text.
It uses the field definitions it is given to determine how a line of text
should be parsed or created.
Any missing definitions are represented as empty fields.
- Author:
- HJC Solutions Ltd (http://canyon.hjcsolutions.co.uk)
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DELIMITER_ATTRIBUTE_NAME
public static final java.lang.String DELIMITER_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
POSITION_ATTRIBUTE_NAME
public static final java.lang.String POSITION_ATTRIBUTE_NAME
- See Also:
- Constant Field Values
DelimitedFieldFlatFileProcessor
public DelimitedFieldFlatFileProcessor(java.util.List<FieldDefinition> fields)
createLine
public java.lang.String createLine(FlatFileLine ffl)
- Description copied from interface:
FlatFileProcessor
- convert the FlatFileLine details into the construct that the flat file
is exepcting. E.g creates the flat file line
- Specified by:
createLine in interface FlatFileProcessor
- Parameters:
ffl - - the FlatFileLine to be turned into a String
- Returns:
- - the output string representation of this flat file line
getField
public DelimitedFieldDefinition getField(java.lang.String fieldName)
- Description copied from interface:
FlatFileProcessor
- Retrieves the defintion of a field by name
- Specified by:
getField in interface FlatFileProcessor
- Parameters:
fieldName - - the name of the field
- Returns:
- - the field definition of the named field
getFields
public java.util.Set<FieldDefinition> getFields()
- Description copied from interface:
FlatFileProcessor
- Retrieves a Set of all the registered field definitions
- Specified by:
getFields in interface FlatFileProcessor
- Returns:
- - all the field definitions for the flat file line
createLine
public FlatFileLine createLine(java.lang.String lineData)
- Description copied from interface:
FlatFileProcessor
- Create a FlatFileLine object from a string of data
- Specified by:
createLine in interface FlatFileProcessor
- Parameters:
lineData - - the data to be used to create the FlatFileLine object
- Returns:
- - the line resultset row for the lineData