Follow the links below to browse sample Javadoc for MJ classes and tools, including the MJ Runtime Library.
com.arsi.mj.maprpt.parser.tuple.inline
contains the following classes and interfaces.
Classes and Interfaces | |
ClobInlineDataHandler | Default implementation of an in-line data handler that does not define a separate data entity (table) for data in trailing lines. |
IInlineDataHandler | Defines handler for processing in-line data, i.e., trailing lines associated with a data tuple that contain embedded data in a custom format. |
RegexInlineDataHandler | Implementation of an in-line data handler that defines a single data entity and populates the columns of the entity with values extracted from the in-line data using regular expressions, or by default literal values. |
RegexTextToFieldParser | Parses fields from amorphous text using regular expressions. |
setLineTypes
(required)
setClobColumnName
public class com.arsi.mj.maprpt.parser.tuple.inline.ClobInlineDataHandler
extends com.arsi.mj.maprpt.parser.tuple.inline.RegexTextToFieldParser
implements com.arsi.mj.maprpt.parser.tuple.inline.IInlineDataHandler
Constructors |
public ClobInlineDataHandler()
|
Methods |
This in-line data handler always returns 1.
public int entities()
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entityBaseClassSuffix(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entityClassName(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum .
public java.lang.String entityClobColumnName(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.util.List entityColumns(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns an empty map since a separate entity table is not defined.
public java.util.Map entityEnums(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entityJoinkeyFieldNames(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entityJoinkeyMaxParentKeyColumnName(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entityJoinkeyMinParentKeyColumnName(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum .
public java.lang.String entityLineTypes(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entityPackageName(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum ,
and always return false since each set of trailing lines is stored as a CLOB
with the associated data row in the target table for Mapper report.
public boolean entitySupportsMultipleRows(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entitySurrogateKeyColumnName(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entitySurrogateKeySequenceName(int anEntityNum)
|
This in-line data handler always expects a value of 1 for anEntityNum
and always returns NULL since a separate entity table is not defined.
public java.lang.String entityTableName(int anEntityNum)
|
This in-line data handler does not support this method since a separate entity table is not defined.
public void explodeClobIntoColumns(java.sql.Clob aClob, long aPkey)
|
This in-line data handler does not support this method since a separate entity table is not defined.
public java.sql.Clob implodeColumnsIntoClob(long aPkey)
|
This in-line data handler always returns NULL since a separate entity table is not defined.
public java.util.List parseInlineData(java.util.List someMaprptLines)
|
Set the name of the CLOB column to add to the target table for the Mapper report
containing the in-line data. This is an optional attribute.
public void setClobColumnName(java.lang.String aName)
|
Set the line types for the entity, i.e., the expected first character(s) of the
trailing lines of in-line data that contain the entity's data. This is an
optional attribute.
public void setLineTypes(java.lang.String aCharset)
|
public interface com.arsi.mj.maprpt.parser.tuple.inline.IInlineDataHandler
Inner Class ParseUnit |
Result of parsing a row of column values for a entity, and any nested
entity data, from in-line data.
public static class com.arsi.mj.maprpt.parser.tuple.inline.IInlineDataHandler.ParseUnit
|
Get column values that comprise an entity row.public final java.util.List columnValues() Get parsed data for nested entities associated with the entity row. public final java.util.List nestedEntityData()
|
Fields |
Placeholder column name for simple CLOB created from all trailing lines in in-line data.public static final java.lang.String SIMPLE_CLOB_COLUMN_NAME = "__SimpleCLOB__"
|
Methods |
Get the count of entities whose data is stored in-line, where any entity
other than the first entity is considered a "nested" entity.
public int entities()
|
Define suffix to append to persistent Hibernate class to arrive at persistent
base class name for specified entity. If no columns are defined for the entity,
a base class suffix should not be defined, either.
public java.lang.String entityBaseClassSuffix(int anEntityNum)
|
Define name of persistent Hibernate class for specified entity. If no columns
are defined for the entity, an entity class name should not be defined, either.
public java.lang.String entityClassName(int anEntityNum)
|
Define the name of the CLOB column to add to the target table for
the Mapper report containing the in-line data.
public java.lang.String entityClobColumnName(int anEntityNum)
|
Define database column(s) for the specified entity, including name, type, length
and nullability. If all trailing lines of in-line data are always to be treated as set of text
lines, never to be broken out into distinct columns, rows or entities, then no
columns need be defined. Instead, a single CLOB column is added to the table
for the Mapper report that contains the inline-data and a separate table is not
created.
public java.util.List entityColumns(int anEntityNum)
|
Define enumerated constants for columns in the specified entity, if any. All
possible values of the database column (except for NULL) must be encompassed
by the values in the enumeration mapping, the type of the column must be compatible
with String (CharacterArrayType , CharacterType
or StringType ) and the column length must accommodate all enumeration values.
public java.util.Map entityEnums(int anEntityNum)
|
Define the field name(s) in the Mapper report containing the in-line data that
form the join key with the separate entity table which hosts the columns extracted
from the in-line data. Note this method returns Mapper field names, and not
database column names.
By default, the surrogate primary key of the target table for the Mapper
report containing the in-line data is used. This assumes there is a one-to-one,
child-to-parent correspondence between each data tuple in the Mapper report and
entities created from the in-line data, i.e., each data tuple is unique. Defining one or more Mapper field names via this method means that data tuples in the parent (Mapper report containing the in-line data) are not unique and join of a child row to the parent entity table using the child's join key values may result in multiple parent rows.
public java.lang.String entityJoinkeyFieldNames(int anEntityNum)
|
Define a surrogate key column whose maximum if taken to arrive at a unique
parent row in target table for the Mapper report containing the in-line data,
where the target table is the parent of the separate entity table hosting columns
extracted from the in-line data. In other words, when joining from a child row in the in-line table back to the parent entity table, the parent row last inserted is returned.
public java.lang.String entityJoinkeyMaxParentKeyColumnName(int anEntityNum)
|
Define a surrogate key column whose minimum is taken to arrive at a unique
parent row in target table for the Mapper report containing the in-line data,
where the target table is the parent of the separate entity table hosting columns
extracted from the in-line data. In other words, when joining from a child row in the in-line table back to the parent entity table, the parent row first inserted is returned.
public java.lang.String entityJoinkeyMinParentKeyColumnName(int anEntityNum)
|
Identifies the line types for the specified entity, i.e., the expected
first character(s) of the trailing lines of in-line data that contain
the entity's data. By default these are assumed to be the period and
asterisk characters.
public java.lang.String entityLineTypes(int anEntityNum)
|
Define package name of persistent Hibernate class for specified entity. If no
columns are defined for the entity, an entity package name should not be defined, either.
public java.lang.String entityPackageName(int anEntityNum)
|
Can multiple rows occur in the in-line data for the specified entity? For example,
all of the trailing lines may be treated as a single CLOB, or a single row with various
column values scattered amongst the lines. Or each trailing line (or pair of trailing
lines, for example) may contain tabular data and is a distinct row.
public boolean entitySupportsMultipleRows(int anEntityNum)
|
Define the name of the surrogate key column (Hibernate id ) in the separate
entity table that hosts the columns extracted from the in-line data.
public java.lang.String entitySurrogateKeyColumnName(int anEntityNum)
|
Define name of database sequence (or equivalent) for generating surrogate key (Hibernate
id ) in the separate entity table that hosts the columns extracted from
the in-line data.
public java.lang.String entitySurrogateKeySequenceName(int anEntityNum)
|
Define database table name for the specified entity. If no columns are defined
for the entity, a table name should not be defined, either.
public java.lang.String entityTableName(int anEntityNum)
|
Given the specified CLOB, parse the CLOB as in-line data (i.e., Mapper trailing lines)
into rows of column values for all entities handled by this class, and update the
database tables that correspond to the entities. The algorithm for parsing the CLOB
as in-line data should essentially be the same as that employed by parseInlineData .
public void explodeClobIntoColumns(java.sql.Clob aClob, long aPkey)
|
Query rows with the specified parent key in the database tables corresponding to
the entities handled by this class, and format a CLOB from the appropriate column
values in the rows. The resulting content should have exactly the same format as
the original trailing lines of in-line data, including line types and line breaks.
This method performs the reverse of the explodeClobIntoColumns method.
public java.sql.Clob implodeColumnsIntoClob(long aPkey)
|
Parse in-line data from trailing lines in Mapper report into rows of column
values for all entities handled by this class. Nested entities should use the
top-down, hierarchical structure supported by the ParseUnit class.If all trailing lines of in-line data are always to be treated as set of text
lines and not broken out into columns, i.e., treated as a single CLOB, this method
should return NULL to use default processing, or return a single column with name
public java.util.List parseInlineData(java.util.List someMaprptLines)
|
setTableName
(required)
setClobColumnName
Next, define one or more columns for the entity, including a default
literal value in case a field value cannot be extracted:
setColumnN
setFieldLiteralN
Parsing and extraction of fields from trailing lines is handled by
the base Define regular expressions that identify and extract field values from
trailing lines, including replacement and/or stripping of characters from
the extracted field value. Note that a field to be extracted as a column
value must have same name as the target column:RegexTextToFieldParser
class, so configure the
parser as needed, e.g.:
setMultiline
setMatchFullInput
setTextReplaceRegex
:
setFieldParseRegexN
setFieldReplaceRegexN
setFieldStripRegexN
Treat this class as "thread-hostile"; since there is no synchronization an instance
should not be used by more than one thread at a time.
public class com.arsi.mj.maprpt.parser.tuple.inline.RegexInlineDataHandler
extends com.arsi.mj.maprpt.parser.tuple.inline.RegexTextToFieldParser
implements com.arsi.mj.maprpt.parser.tuple.inline.IInlineDataHandler
Constructors
public RegexInlineDataHandler()
Methods
This in-line data handler always defines a single entity (table).
public int entities()
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityBaseClassSuffix(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityClassName(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityClobColumnName(int anEntityNum)
To define database column(s) for the entity, use the
setColumnN
methods.
This in-line data handler always expects a value of 1
for anEntityNum
.
public java.util.List entityColumns(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.util.Map entityEnums(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityJoinkeyFieldNames(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityJoinkeyMaxParentKeyColumnName(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityJoinkeyMinParentKeyColumnName(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityLineTypes(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityPackageName(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
,
and always return false
since a each set of trailing lines is assumed to represent a single row.
public boolean entitySupportsMultipleRows(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entitySurrogateKeyColumnName(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entitySurrogateKeySequenceName(int anEntityNum)
This in-line data handler always expects a value of
1
for anEntityNum
.
public java.lang.String entityTableName(int anEntityNum)
This method is not currently supported.
public void explodeClobIntoColumns(java.sql.Clob aClob, long aPkey)
throws com.arsi.mj.MJTranslateException
This method is not currently supported.
public java.sql.Clob implodeColumnsIntoClob(long aPkey)
throws com.arsi.mj.MJTranslateException
Parse the trailing, in-line Mapper report lines using the regular expressions that have
been set for each field to be extracted. The extracted fields and any default literals
are stored as the column values of a single entity row that has no nested, child
entities.
public java.util.List parseInlineData(java.util.List someMaprptLines)
throws com.arsi.mj.MJTranslateException
Define suffix to append to persistent Hibernate class to arrive at persistent
base class name for the entity. This is a required attribute.
aSuffix
- a valid class prefix name.public void setBaseClassSuffix(java.lang.String aSuffix)
Define class name of Hibernate persistent class for the entity. This is a required attribute.
aName
- a valid class name.public void setClassName(java.lang.String aName)
Set the name of the CLOB column to add to the target table for the Mapper report
containing the in-line data. This is an optional attribute.
aName
- CLOB column name.public void setClobColumnName(java.lang.String aName)
Define column 1 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn1(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 10 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn10(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 11 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn11(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 12 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn12(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 13 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn13(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 14 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn14(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 15 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn15(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 16 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn16(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 17 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn17(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 18 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn18(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 19 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn19(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 2 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn2(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 20 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn20(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 21 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn21(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 22 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn22(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 23 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn23(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 24 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn24(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 25 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn25(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 3 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn3(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 4 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn4(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 5 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn5(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 6 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn6(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 7 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn7(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 8 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn8(com.arsi.mj.config.atoms.ColumnDef aColdef)
Define column 9 of entity whose fields are to be parsed from the input.
aColdef
- a column definition.public void setColumn9(com.arsi.mj.config.atoms.ColumnDef aColdef)
Set enumeration for column 1. All possible values of the database column (except for
NULL) must be encompassed by the values in the enumeration mapping, the type of the
column must be compatible with
String
(CharacterArrayType
,
CharacterType
or StringType
) and the column length must
accommodate all enumeration values.
anEnum
- string-based enumeration mapping where key and enumeration constant value are the same.public void setEnumForColumn1(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 10.
public void setEnumForColumn10(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 2.
public void setEnumForColumn2(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 3.
public void setEnumForColumn3(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 4.
public void setEnumForColumn4(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 5.
public void setEnumForColumn5(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 6.
public void setEnumForColumn6(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 7.
public void setEnumForColumn7(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 8.
public void setEnumForColumn8(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set enumeration for column 9.
public void setEnumForColumn9(com.arsi.mj.maprpt.enums.StringKeyEnumMapping anEnum)
Set a literal value for field 1 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral1(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 9 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral10(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 10.
public void setFieldLiteral10Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 11 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral11(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 11.
public void setFieldLiteral11Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 12 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral12(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 12.
public void setFieldLiteral12Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 13 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral13(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 13.
public void setFieldLiteral13Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 14 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral14(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 14.
public void setFieldLiteral14Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 15 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral15(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 15.
public void setFieldLiteral15Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 16 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral16(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 16.
public void setFieldLiteral16Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 17 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral17(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 17.
public void setFieldLiteral17Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 18 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral18(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 18.
public void setFieldLiteral18Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 19 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral19(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 19.
public void setFieldLiteral19Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 1, allowing a default value to be specified
in lieu of a value parsed from the input text.
aName
- name of the field, i.e., the corresponding entity attribute name.
aLiteral
- a valid literal string for the data type of the target column.public void setFieldLiteral1Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 2 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral2(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 20 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral20(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 20.
public void setFieldLiteral20Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 21 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral21(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 21.
public void setFieldLiteral21Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 22 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral22(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 22.
public void setFieldLiteral22Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 23 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral23(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 23.
public void setFieldLiteral23Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 24 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral24(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 24.
public void setFieldLiteral24Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 25 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral25(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 25.
public void setFieldLiteral25Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 2.
public void setFieldLiteral2Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 3 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral3(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 3.
public void setFieldLiteral3Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 4 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral4(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 4.
public void setFieldLiteral4Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 5 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral5(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 5.
public void setFieldLiteral5Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 6 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral6(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 6.
public void setFieldLiteral6Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 7 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral7(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 7.
public void setFieldLiteral7Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 8 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral8(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 8.
public void setFieldLiteral8Api(java.lang.String aName, java.lang.String aLiteral)
Set a literal value for field 9 (allowing a default in lieu of parsed value) using varargs.
someArgs
- variable arguments expected to be aName, aLiteral
.MJTranslateException
- if regular expression is invalid.public void setFieldLiteral9(java.lang.String someArgs)
throws com.arsi.mj.MJTranslateException
Set a literal value for field 9.
public void setFieldLiteral9Api(java.lang.String aName, java.lang.String aLiteral)
Set the field name(s) in the Mapper report containing the in-line data that
form the join key with the entity table. This is an optional attribute.
someNames
- canonical name (no whitespace) of the join fields. Note these are Mapper
field names, and not database column names.public void setJoinkeyFieldNames(java.lang.String someNames)
Set surrogate key column whose maximum if taken to arrive at a unique parent row in
target table for the Mapper report containing the in-line data. This is an optional attribute.
aColumnName
- surrogate key column name whose maximum value is taken when joining from a child row
in the in-line table back to the parent entity table.public void setJoinkeyMaxParentKeyColumnName(java.lang.String aColumnName)
Set surrogate key column whose minimum if taken to arrive at a unique parent row in
target table for the Mapper report containing the in-line data. This is an optional attribute.
aColumnName
- surrogate key column name whose minimum value is taken when joining from a child row
in the in-line table back to the parent entity table.public void setJoinkeyMinParentKeyColumnName(java.lang.String aColumnName)
Set the line types for the entity, i.e., the expected first character(s) of the
trailing lines of in-line data that contain the entity's data. This is an
optional attribute.
aCharset
- string that comprises the character set of expected first character(s)
of the entity's trailing lines.public void setLineTypes(java.lang.String aCharset)
Define package name of Hibernate persistent class for the entity. This is a required attribute.
aName
- a valid package name.public void setPackageName(java.lang.String aName)
Set the name of the surrogate key column in the separate entity table
that hosts the columns extracted from the in-line data (this is
an optional attribute).
aName
- name of the surrogate key column.public void setSurrogateKeyColumnName(java.lang.String aName)
Set name of database sequence (or equivalent) for generating surrogate key (Hibernate
id
) in the separate entity table that hosts the columns extracted from
the in-line data (this is an optional attribute).
aName
- name of the surrogate key sequence.public void setSurrogateKeySequenceName(java.lang.String aName)
Define database table name for the entity. This is a required attribute.
aName
- a valid database table name.public void setTableName(java.lang.String aName)
validate
such that if field numbers do not
run consecutively (1 ... N, where N is the number of defined fields), field names must be
unique. Otherwise, it can be difficult to identify the values returned by parseFields
.
Treat this class as "thread-hostile", since instances are intended to be created,
used and discarded by a single thread.
public class com.arsi.mj.maprpt.parser.tuple.inline.RegexTextToFieldParser
extends java.lang.Object
Constructors |
public RegexTextToFieldParser()
|
Methods |
Use varags to set regular expression that parses specified field from input text.
public void doSetFieldParseRegex(int aFieldNum, java.lang.String someArgs)
|
Use varags to set match-and-replace regular expression to apply to contents of field
after the field has been parsed and extracted.
public void doSetFieldReplaceRegex(int aFieldNum, java.lang.String someArgs)
|
Use varags to set match-and-strip regular expression to apply to contents of
field after the field has been parsed and extracted.
public void doSetFieldStripRegex(int aFieldNum, java.lang.String someArgs)
|
Indicates whether parsing should fail with an exception if the regular expression
for each field cannot be matched in the input text.
public boolean failUnmatched()
|
Is Pattern.CASE_INSENSITIVE set for regular expressions employed by this class instance?
public final boolean isCaseInsensitive()
|
Is Pattern.MULTILINE set for regular expressions employed by this class instance?
public final boolean isMultiline()
|
Is Pattern.UNIX_LINES set for regular expressions employed by this class instance?
public final boolean isUnixLines()
|
Indicates whether to keep or discard zero length matches (some regular expressions
can produce a match of zero characters).
public boolean keepZeroLengthMatches()
|
Indicates whether field parsing operates in match-and-advance mode (portion of the
input text that was matched is discarded before the next field is matched) or
match-full-input mode, where each regular expression is matched against the full
text input. In terms of Java regular expression APIs, match-and-advance uses Matcher.find
while match-full-input uses Matcher.lookingAt .
public boolean matchFullInput()
|
Parse and extract fields from input text. Match-and-replace and/or
match-and-strip regular expressions are applied to the input text, then
successive field parse expressions are are evaluated against the input
using either match-and-advance or match-full-input.
public java.util.List parseFields(java.lang.String aText)
|
Set or clear Pattern.CASE_INSENSITIVE for regular expressions employed by this class instance.
public final void setCaseInsensitive(boolean anEnableFlag)
|
Set whether parsing should fail with an exception if the regular expression
for each field cannot be matched in the input text.
public void setFailUnmatched(boolean aFailFlag)
|
Set regular expression used to parse field 1 from input text using varargs.
public void setFieldParseRegex1(java.lang.String someArgs)
|
Set regular expression used to parse field 10 from input text using varargs.
public void setFieldParseRegex10(java.lang.String someArgs)
|
Set the regular expression used to parse field 10 from the input text.
public void setFieldParseRegex10Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 10 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex10Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set the regular expression used to parse field 1 from the input text. The parsed
field is assumed to be referenced as \1 , i.e., the first "capturing
group" in regular expression parlance. For example, in the regular expression
\s*([a-z]*)[0-9]* , the first (and only) capturing group is ([a-z]*) ,
which selects lower case letters as the field content.
public void setFieldParseRegex1Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 1 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups". For example, in
the regular expression \s*([a-z]*)\s*\w+\s*([0-9]*) , the characters matched
by capturing groups ([a-z]*) and ([0-9]*) might comprise the
field contents, but in reverse order, i.e., $2$1<\code>.
|
Set regular expression used to parse field 2 from input text using varargs.
public void setFieldParseRegex2(java.lang.String someArgs)
|
Set the regular expression used to parse field 2 from the input text.
public void setFieldParseRegex2Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 2 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex2Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set regular expression used to parse field 3 from input text using varargs.
public void setFieldParseRegex3(java.lang.String someArgs)
|
Set the regular expression used to parse field 3 from the input text.
public void setFieldParseRegex3Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 3 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex3Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set regular expression used to parse field 4 from input text using varargs.
public void setFieldParseRegex4(java.lang.String someArgs)
|
Set the regular expression used to parse field 4 from the input text.
public void setFieldParseRegex4Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 4 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex4Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set regular expression used to parse field 5 from input text using varargs.
public void setFieldParseRegex5(java.lang.String someArgs)
|
Set the regular expression used to parse field 5 from the input text.
public void setFieldParseRegex5Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 5 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex5Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set regular expression used to parse field 6 from input text using varargs.
public void setFieldParseRegex6(java.lang.String someArgs)
|
Set the regular expression used to parse field 6 from the input text.
public void setFieldParseRegex6Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 6 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex6Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set regular expression used to parse field 7 from input text using varargs.
public void setFieldParseRegex7(java.lang.String someArgs)
|
Set the regular expression used to parse field 7 from the input text.
public void setFieldParseRegex7Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 7 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex7Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set regular expression used to parse field 8 from input text using varargs.
public void setFieldParseRegex8(java.lang.String someArgs)
|
Set the regular expression used to parse field 8 from the input text.
public void setFieldParseRegex8Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 8 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex8Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set regular expression used to parse field 9 from input text using varargs.
public void setFieldParseRegex9(java.lang.String someArgs)
|
Set the regular expression used to parse field 9 from the input text.
public void setFieldParseRegex9Api(java.lang.String aName, java.lang.String aFieldSelectorRegex)
|
Set the regular expression used to parse field 9 from the input text, allowing the
field contents to be pieced together from multiple "capturing groups".
public void setFieldParseRegex9Api(java.lang.String aName, java.lang.String aFieldSelectorRegex, java.lang.String aFieldBackrefRegex)
|
Set match-and-replace regular expression to apply to contents of field 1 after
the field has been parsed and extracted using vargs.
public void setFieldReplaceRegex1(java.lang.String someArgs)
|
Set match-and-replace regular expression to apply to contents of field 10 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex10Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 1 after
the field has been parsed and extracted from the input text, allowing simple post
processing of the parsed field value. Match-and-replace expressions accumulate in
the order this setter method is called, and are processed before stripping.
public void setFieldReplaceRegex1Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 2 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex2Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 3 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex3Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 4 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex4Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 5 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex5Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 6 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex6Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 7 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex7Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 8 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex8Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-replace regular expression to apply to contents of field 9 after
the field has been parsed and extracted from the input text.
public void setFieldReplaceRegex9Api(java.lang.String aName, java.lang.String aRegex, java.lang.String aReplacment)
|
Set match-and-strip regular expression to apply to contents of field 1 after
the field has been parsed and extracted using vargs.
public void setFieldStripRegex1(java.lang.String someArgs)
|
Set match-and-strip regular expression to apply to contents of field 10 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex10Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 1 after
the field has been parsed and extracted from the input text, allowing simple post
processing of the parsed field value. Match-and-strip expressions accumulate in
the order this setter method is called, and are processed after replacement.
public void setFieldStripRegex1Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 2 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex2Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 3 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex3Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 4 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex4Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 5 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex5Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 6 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex6Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 7 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex7Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 8 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex8Api(java.lang.String aName, java.lang.String aRegex)
|
Set match-and-strip regular expression to apply to contents of field 9 after
the field has been parsed and extracted from the input text.
public void setFieldStripRegex9Api(java.lang.String aName, java.lang.String aRegex)
|
Set whether to keep or discard zero length matches.
public void setKeepZeroLengthMatches(boolean aKeepFlag)
|
Set whether field parsing operates in match-and-advance mode or match-full-input mode.
public void setMatchFullInput(boolean aFullInputFlag)
|
Set or clear Pattern.MULTILINE for regular expressions employed by this class instance.
public final void setMultiline(boolean anEnableFlag)
|
Set regular expression to match and replace in input text before parsing
fields from input. Match-and-replace input expressions accumulate in the
order this setter method is called, and are processed before input stripping.
public void setTextReplaceRegex(java.lang.String aRegex, java.lang.String aReplacement)
|
Set regular expression to match and strip from input text before parsing
fields from input. Match-and-replace input expressions accumulate in the
order this setter method is called, and are processed after input replacement.
public void setTextStripRegex(java.lang.String aRegex)
|
Set or clear Pattern.UNIX_LINES for regular expressions employed by this class instance.
public final void setUnixLines(boolean anEnableFlag)
|
public void validate()
|