Package cdc.impex.templates
Class ColumnTemplate<T>
java.lang.Object
cdc.impex.templates.ColumnTemplate<T>
- Type Parameters:
T- The column data type.
Description of a column template.
A column is described by:
- A header (name or pattern).
A name column represents a single actual column.
A pattern column represents a set of actual columns. - A
Usage. - A data type.
- An optional default value.
- An optional description.
It is used when sample files are generated. - An optional
Checker.
It can be used to add more checks to data type, for example, to check the length of string, the domain of a number, ... - The severity of a failed check.
- A string to data type converter.
- A data type to string converter.
- An optional Content Validation type.
- An optional Content Validation operator.
- An optional list of Content Validation values.
If data type is a primitive or enum data type, default content validation data are automatically set.
- Author:
- Damien Carbonne
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> ColumnTemplate.Builder<T>builder(ColumnTemplate<T> model) Creates a new Builder initialized from a Template.static <T> ColumnTemplate.Builder<T>Creates an empty new Builder.voidvoidcdc.validation.checkers.Checker<T>cdc.issues.IssueSeveritycdc.office.ss.ContentValidation.Operatorcdc.office.ss.ContentValidation.TypegetDef()cdc.office.tables.HeaderCellgetLabel()getName()Returns the column name.Returns the column pattern.getUsage()booleanbooleanisName()booleantoString()
-
Method Details
-
getHeader
public cdc.office.tables.HeaderCell getHeader() -
isName
public boolean isName()- Returns:
trueif the header of the column is a name.
-
checkIsName
public void checkIsName() -
isPattern
public boolean isPattern()- Returns:
trueif the header of the column is a pattern.
-
checkIsPattern
public void checkIsPattern() -
getLabel
- Returns:
- The column label (its name or pattern).
-
getName
Returns the column name.WARNING: column must have a
name header.- Returns:
- The column name.
- Throws:
AssertionError- When the header of this template is not a name.
-
getPattern
Returns the column pattern.WARNING: column must have a
pattern header.- Returns:
- The column pattern.
- Throws:
AssertionError- When the header of this template is not a pattern.
-
getUsage
- Returns:
- The column usage.
-
getDataType
- Returns:
- The column data type.
-
getDef
- Returns:
- The column default value.
-
getPrimitive
- Returns:
- The
Primitivetype of this column, ornull.
-
getDescription
- Returns:
- The column description.
-
getCheckerOrNull
- Returns:
- The checker or
null.
-
hasChecker
public boolean hasChecker() -
getCheckFailureSeverity
public cdc.issues.IssueSeverity getCheckFailureSeverity()- Returns:
- The severity of a check failure.
-
getImportConverter
- Returns:
- the converter used to convert a string to data type.
-
getExportConverter
- Returns:
- the converter used to convert a data type to a string.
-
getComment
- Returns:
- The comment that should be used to describe this column.
-
getContentValidationType
public cdc.office.ss.ContentValidation.Type getContentValidationType()- Returns:
- The content validation type.
-
getContentValidationOperator
public cdc.office.ss.ContentValidation.Operator getContentValidationOperator()- Returns:
- The content validation operator.
-
getContentValidationValues
- Returns:
- The content validation values.
-
toString
-
newBuilder
- Returns:
- A new Builder initialized with data from this Template.
-
builder
Creates an empty new Builder.- Type Parameters:
T- The data type.- Parameters:
dataType- The data class.- Returns:
- A new Builder typed with
dataType.
-
builder
Creates a new Builder initialized from a Template.- Type Parameters:
T- The data type.- Parameters:
model- The Template model.- Returns:
- A new Builder initialized with
model.
-