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
Nested ClassesModifier and TypeClassDescriptionstatic final classA 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
Constructors -
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 JavaListof 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- AStringthat contains the comma-separated list.- Returns:
- A
TemplateReferenceExtractor.ColumnReferenceOrConstantValuefor each string in the comma-separated list.
-
determineColumnReferencesInTemplate
public List<TemplateReferenceExtractor.ColumnReferenceOrConstantValue> determineColumnReferencesInTemplate(List<String> keysTemplate) For a template that is represented by a JavaListof strings, determines which strings are column references and which are constant values.- Parameters:
keysTemplate- TheStrings that make up the template.- Returns:
- A
TemplateReferenceExtractor.ColumnReferenceOrConstantValuefor each string in theList.
-