public final class FlatFileMethods extends Object
Constructor and Description |
---|
FlatFileMethods() |
Modifier and Type | Method and Description |
---|---|
static GloopCursor |
getDelimitedFileInputCursor(InputStream flatFileData,
String encoding,
char delimiter,
Character quoteCharacter,
Character commentCharacter,
Character escapeCharacter,
int firstRow,
boolean ignoreSurroundingSpaces,
boolean allowMissingColumnNames,
boolean ignoreEmptyLines,
String nullString,
String modelReferenceName,
GloopModel modelTemplate,
String[] fieldNames,
String recordSeparator,
GloopExecutionContext context)
Return a Gloop cursor that's used to read in a delimited flat file.
|
static GloopCursor |
getDelimitedFileOutputCursor(OutputStream flatFileData,
String encoding,
char delimiter,
Character quoteCharacter,
String quoteMode,
Character escapeCharacter,
String nullString,
String modelReferenceName,
GloopModel modelTemplate,
String[] fieldNames,
String recordSeparator,
boolean writeHeaderRecord,
GloopExecutionContext context)
Return a Gloop cursor that's used to write to a delimited flat file.
|
static GloopCursor |
getExcelFileInputCursor(InputStream flatFileData,
int sheetNumber,
int firstDataRow,
String modelReferenceName,
GloopModel modelTemplate,
String[] fieldNames,
GloopExecutionContext context)
Return a Gloop cursor that's used to read in an Excel file.
|
static GloopCursor |
getExcelFileOutputCursor(OutputStream flatFileData,
String modelReferenceName,
GloopModel modelTemplate,
String[] fieldNames,
boolean writeHeaderRecord,
GloopExecutionContext context)
Return a Gloop cursor that's used to write to an Excel file.
|
static GloopCursor |
getFixedWidthFileInputCursor(InputStream flatFileData,
String encoding,
String recordSeparator,
char paddingCharacter,
boolean leftJustified,
int[] widths,
int firstDataRow,
String modelReferenceName,
GloopModel modelTemplate,
String[] fieldNames,
GloopExecutionContext context)
Return a Gloop cursor that's used to read in a fixed-width flat file.
|
static GloopCursor |
getFixedWidthOutputCursor(OutputStream flatFileData,
String encoding,
int[] widths,
String recordSeparator,
char paddingCharacter,
String modelReferenceName,
GloopModel modelTemplate,
String[] fieldNames,
boolean leftJustified,
boolean writeHeaderRecord,
GloopExecutionContext context)
Return a Gloop cursor that's used to write to a fixed-width flat file.
|
static GloopCursor |
getFlatFileInputCursor(InputStream flatFileData,
FlatFileDescriptor flatFileDescriptor,
GloopExecutionContext context) |
static GloopCursor |
getFlatFileInputCursor(InputStream flatFileData,
String flatFileDescriptorName,
GloopExecutionContext context)
Return a Gloop cursor that's used to read in a flat file.
|
static GloopCursor |
getFlatFileOutputCursor(OutputStream flatFileData,
String flatFileDescriptorName,
GloopExecutionContext context)
Return a Gloop cursor that's used to write to a flat file.
|
public static GloopCursor getFlatFileInputCursor(InputStream flatFileData, String flatFileDescriptorName, GloopExecutionContext context) throws GloopException
flatFileData
- the flat file data that will be readflatFileDescriptorName
- the namespace of the flat file descriptorcontext
- the Gloop execution context (automatically mapped by Gloop)GloopException
- when a cursor cannot be producedpublic static GloopCursor getFlatFileInputCursor(InputStream flatFileData, FlatFileDescriptor flatFileDescriptor, GloopExecutionContext context)
public static GloopCursor getDelimitedFileInputCursor(InputStream flatFileData, @GloopParameter(defaultValue="UTF-8") String encoding, @GloopParameter(defaultValue=",") char delimiter, Character quoteCharacter, Character commentCharacter, Character escapeCharacter, @GloopParameter(defaultValue="0") int firstRow, @GloopParameter(defaultValue="false") boolean ignoreSurroundingSpaces, @GloopParameter(defaultValue="false") boolean allowMissingColumnNames, @GloopParameter(defaultValue="false") boolean ignoreEmptyLines, String nullString, String modelReferenceName, GloopModel modelTemplate, String[] fieldNames, @GloopParameter(defaultValue="\n") String recordSeparator, GloopExecutionContext context)
flatFileData
- the flat file data that will be readencoding
- the encoding to be used; default is UTF-8delimiter
- the column delimiter; default is ,quoteCharacter
- the the quote character to use to usecommentCharacter
- character used to signify the start of a comment;
if null
, commenting is disabledescapeCharacter
- character used to escape other charactersfirstRow
- the 0-based index that signifies the first data row of the inputignoreSurroundingSpaces
- flag for ignoring spaces around column values;
if true
, column values will be trimmedallowMissingColumnNames
- whether or not missing column names are allowed when parsing the header lineignoreEmptyLines
- if true
, empty lines will be ignorednullString
- a string signifying what a null
value ismodelReferenceName
- a namespace to a model that is used to determine what the model of the cursor
will look likemodelTemplate
- An existing model used to determine what the model of the cursor will look like.
The value of the model should not be null
.
To ensure the model is non-null, the model should not be an array,
and should have at least one property that has a non-null value.fieldNames
- a string array of the flat file's field names; used to create a Gloop model
with the given names as its propertiesrecordSeparator
- the character signifying the end of a record; default is \ncontext
- the Gloop execution context (automatically mapped by Gloop)public static GloopCursor getFixedWidthFileInputCursor(InputStream flatFileData, @GloopParameter(defaultValue="UTF-8") String encoding, @GloopParameter(defaultValue="\n") String recordSeparator, @GloopParameter(defaultValue=" ") char paddingCharacter, @GloopParameter(defaultValue="true") boolean leftJustified, int[] widths, @GloopParameter(defaultValue="0") int firstDataRow, String modelReferenceName, GloopModel modelTemplate, String[] fieldNames, GloopExecutionContext context)
flatFileData
- the flat file data that will be readencoding
- the encoding to be used; default is UTF-8recordSeparator
- a character signifying the end of a record; default is \npaddingCharacter
- a character that's used to pad columns; default value is spaceleftJustified
- specifies whether or not the values are left-justified; default is true
widths
- an array of column widths to usefirstDataRow
- the 0-based index that signifies the first data row of the inputmodelReferenceName
- a namespace to a model that is used to determine what the model of the cursor
will look likemodelTemplate
- An existing model used to determine what the model of the cursor will look like.
The value of the model should not be null
.
To ensure the model is non-null, the model should not be an array,
and should have at least one property that has a non-null value.fieldNames
- a string array of the flat file's field names; used to create a Gloop model
with the given names as its propertiescontext
- the Gloop execution context (automatically mapped by Gloop)public static GloopCursor getExcelFileInputCursor(InputStream flatFileData, @GloopParameter(defaultValue="0") int sheetNumber, @GloopParameter(defaultValue="0") int firstDataRow, String modelReferenceName, GloopModel modelTemplate, String[] fieldNames, GloopExecutionContext context)
flatFileData
- the Excel file that will be readsheetNumber
- the sheet to process; default is 0; a value of -1 will process all sheetsfirstDataRow
- the 0-based index that signifies the first data row of the input; default is 0modelReferenceName
- a namespace to a model that is used to determine what the model of the cursor
will look likemodelTemplate
- An existing model used to determine what the model of the cursor will look like.
The value of the model should not be null
.
To ensure the model is non-null, the model should not be an array,
and should have at least one property that has a non-null value.fieldNames
- a string array of the flat file's field names; used to create a Gloop model
with the given names as its propertiescontext
- the Gloop execution context (automatically mapped by Gloop)public static GloopCursor getFlatFileOutputCursor(OutputStream flatFileData, String flatFileDescriptorName, GloopExecutionContext context)
flatFileData
- the output stream where data will be written toflatFileDescriptorName
- the namespace of the flat file descriptorcontext
- the Gloop execution context (automatically mapped by Gloop)public static GloopCursor getDelimitedFileOutputCursor(OutputStream flatFileData, @GloopParameter(defaultValue="UTF-8") String encoding, @GloopParameter(defaultValue=",") char delimiter, Character quoteCharacter, @GloopParameter(defaultValue="All",choices={"All","Minimal","Non Numeric","None"}) String quoteMode, Character escapeCharacter, String nullString, String modelReferenceName, GloopModel modelTemplate, String[] fieldNames, @GloopParameter(defaultValue="\n") String recordSeparator, @GloopParameter(defaultValue="true") boolean writeHeaderRecord, GloopExecutionContext context)
flatFileData
- the output stream where data will be written toencoding
- the encoding to be used; default is UTF-8delimiter
- the column delimiter; default is ,quoteCharacter
- the quote character to usequoteMode
- Tells the cursor how to quote column values.
Choices are: All, Minimal, Non Numeric,
and None.
escapeCharacter
- character used to escape other charactersnullString
- a string signifying what a null
value ismodelReferenceName
- a namespace to a model that is used to determine what the model of the cursor
will look likemodelTemplate
- An existing model used to determine what the model of the cursor will look like.
The value of the model should not be null
.
To ensure the model is non-null, the model should not be an array,
and should have at least one property that has a non-null value.fieldNames
- a string array of the flat file's field names; used to create a Gloop model
with the given names as its propertiesrecordSeparator
- a character signifying the end of a record; default is \nwriteHeaderRecord
- if true
, a header record containing the column names will be writtencontext
- the Gloop execution context (automatically mapped by Gloop)public static GloopCursor getFixedWidthOutputCursor(OutputStream flatFileData, @GloopParameter(defaultValue="UTF-8") String encoding, int[] widths, @GloopParameter(defaultValue="\n") String recordSeparator, @GloopParameter(defaultValue=" ") char paddingCharacter, String modelReferenceName, GloopModel modelTemplate, String[] fieldNames, @GloopParameter(defaultValue="true") boolean leftJustified, @GloopParameter(defaultValue="true") boolean writeHeaderRecord, GloopExecutionContext context)
flatFileData
- the output stream where data will be written toencoding
- the encoding to be used; default is UTF-8widths
- an array of column widths to userecordSeparator
- a character signifying the end of a record; default is \npaddingCharacter
- a character that's used to pad columns; default value is spacemodelReferenceName
- a namespace to a model that is used to determine what the model of the cursor
will look likemodelTemplate
- An existing model used to determine what the model of the cursor will look like.
The value of the model should not be null
.
To ensure the model is non-null, the model should not be an array,
and should have at least one property that has a non-null value.fieldNames
- a string array of the flat file's field names; used to create a Gloop model
with the given names as its propertiesleftJustified
- specifies whether or not the values are left-justified; default is true
writeHeaderRecord
- if true
, a header record containing the column names will be writtencontext
- the Gloop execution context (automatically mapped by Gloop)public static GloopCursor getExcelFileOutputCursor(OutputStream flatFileData, String modelReferenceName, GloopModel modelTemplate, String[] fieldNames, @GloopParameter(defaultValue="true") boolean writeHeaderRecord, GloopExecutionContext context)
flatFileData
- the output stream where data will be written tomodelReferenceName
- a namespace to a model that is used to determine what the model of the cursor
will look likemodelTemplate
- An existing model used to determine what the model of the cursor will look like.
The value of the model should not be null
.
To ensure the model is non-null, the model should not be an array,
and should have at least one property that has a non-null value.fieldNames
- a string array of the flat file's field names; used to create a Gloop model
with the given names as its propertieswriteHeaderRecord
- if true
, a header record containing the column names will be writtencontext
- the Gloop execution context (automatically mapped by Gloop)Copyright © 2023. All rights reserved.