Class TemplateReferenceExtractor
java.lang.Object
com.i2group.disco.infostore.importer.TemplateReferenceExtractor
A utility class for determining whether strings in templates are references to values in columns
(specified by
$(COLUMN_NAME)
) or constant values.
If a string in a template element starts with any sequence other than $(
, it is
treated as a constant.
- Since:
- 9.0
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic final class
A descriptor of whether a string in a template is a constant value (in which case it requires no further processing), or a reference to a value in a column (in which case it should be substituted for the value). -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptiondetermineColumnReferencesInTemplate
(String keysTemplate) For a template that is represented by a comma-separated list of strings, determines which strings are column references and which are constant values.determineColumnReferencesInTemplate
(List<String> keysTemplate) For a template that is represented by a JavaList
of strings, determines which strings are column references and which are constant values.
-
Constructor Details
-
TemplateReferenceExtractor
public TemplateReferenceExtractor()
-
-
Method Details
-
determineColumnReferencesInTemplate
public List<TemplateReferenceExtractor.ColumnReferenceOrConstantValue> determineColumnReferencesInTemplate(String keysTemplate) For a template that is represented by a comma-separated list of strings, determines which strings are column references and which are constant values.This method relies on Java
String.split(String)
functionality. It is not suitable for implementations where the template strings themselves contain commas. In such cases, form the template into a list of suitable elements and calldetermineColumnReferencesInTemplate(List)
instead.- Parameters:
keysTemplate
- AString
that contains the comma-separated list.- Returns:
- A
TemplateReferenceExtractor.ColumnReferenceOrConstantValue
for each string in the comma-separated list.
-
determineColumnReferencesInTemplate
public List<TemplateReferenceExtractor.ColumnReferenceOrConstantValue> determineColumnReferencesInTemplate(List<String> keysTemplate) For a template that is represented by a JavaList
of strings, determines which strings are column references and which are constant values.- Parameters:
keysTemplate
- TheString
s that make up the template.- Returns:
- A
TemplateReferenceExtractor.ColumnReferenceOrConstantValue
for each string in theList
.
-