Package cdc.impex.templates
Class SheetTemplate
java.lang.Object
cdc.impex.templates.SheetTemplate
Description of a sheet template.
It always has an optional action column.
- Author:
- Damien Carbonne
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final ImportActionstatic final Stringstatic final Comparator<SheetTemplate> -
Method Summary
Modifier and TypeMethodDescriptionstatic SheetTemplate.Builderbuilder()static SheetTemplate.Builderbuilder(SheetTemplate model) booleancontainsColumn(String name) Returnstrueif this sheet template contains a column with a particular name.booleancontainsMatchingColumn(String name) getColumn(cdc.office.tables.HeaderCell header) Returns the column that has a given name.List<cdc.office.tables.HeaderCell>Deprecated, for removal: This API element is subject to removal in a future version.List<cdc.office.tables.HeaderCell>getColumnHeaders(Usage usage) Returns a list of column headers that match a usage.List<ColumnTemplate<?>>List<ColumnTemplate<?>>getColumns(Usage usage) cdc.office.tables.HeadergetMatchingColumn(String name) getName()getQName()booleaninstantiate(String... patternReplacement) instantiate(List<String> patternReplacement) booleanisActionColumn(ColumnTemplate<?> column) toString()
-
Field Details
-
DEFAULT_ACTION
-
DEFAULT_ACTION_COLUMN_NAME
- See Also:
-
DOMAIN_NAME_COMPARATOR
-
-
Method Details
-
getDomain
- Returns:
- The template domain.
-
getName
- Returns:
- The template name.
-
getQName
- Returns:
- The template qualified name (domain.name).
-
getDescription
- Returns:
- The template description.
-
getDefaultAction
- Returns:
- The default import action, used when action is not defined.
-
getActionColumnName
- Returns:
- The name of the action column.
-
getActionColumn
- Returns:
- The action column
-
isActionColumn
-
getColumns
- Returns:
- The template columns.
-
getColumns
-
getHeader
public cdc.office.tables.Header getHeader()- Returns:
- The header.
-
hasPatterns
public boolean hasPatterns()- Returns:
trueif this sheet template contains pattern columns.
-
getColumnHeaders
@Deprecated(forRemoval=true, since="2024-07-13") public List<cdc.office.tables.HeaderCell> getColumnHeaders()Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- The template column headers.
-
getColumnHeaders
Returns a list of column headers that match a usage.- Parameters:
usage- The usage.- Returns:
- A list of column headers that match
usage.
-
getColumn
- Parameters:
header- The cell header.- Returns:
- The template associated to
header. - Throws:
IllegalArgumentException- Whenheaderisnull.NoSuchElementException- When there is no associated template.
-
getColumn
Returns the column that has a given name.- Parameters:
name- The name.- Returns:
- The column that is named
name. - Throws:
IllegalArgumentException- Whennameisnull.NoSuchElementException- When there is no column namedname.
-
containsColumn
Returnstrueif this sheet template contains a column with a particular name.WARNING: This only works for name columns.
- Parameters:
name- The name.- Returns:
trueif this sheet template contains a column namesname.
-
getMatchingColumn
- Parameters:
name- The actual name.- Returns:
- The column that matches
name. - Throws:
NoSuchElementException- When there is not a single column matchingname.
-
containsMatchingColumn
- Parameters:
name- The actual name.- Returns:
truewhen there a single column matchingname.
-
instantiate
- Parameters:
patternReplacement- The list of names that must be used as actual columns names for pattern columns.- Returns:
- A new SheetTemplateInstance whose template is this object and header is built from names of name columns and substitutions for pattern columns.
-
instantiate
- Parameters:
patternReplacement- The array of names that must be used as actual columns names for pattern columns.- Returns:
- A new SheetTemplateInstance whose template is this object and header is built from names of name columns and substitutions for pattern columns.
-
newBuilder
-
toString
-
builder
-
builder
-