public abstract class TemplateBean
extends java.lang.Object
Copyright (C) 2012-2016 JIOWA Business Solutions GmbH, Bettinastr. 30 , 60325 Frankfurt am Main, Germany
Homepage: www.jiowa.de
All rights reserved.
Download: www.jiowa.de/download.html
License: www.jiowa.de/license.html
Modifier and Type | Field and Description |
---|---|
protected TemplateBean |
parent
the parent template bean for this bean
|
protected java.util.List<BeanPart> |
partList
The parts of which this bean consists of for the toString() method.
|
protected SubTemplateStructureID2ClassMap |
subTemplateStructureID2ClassMap
Stores all ID to class mappings for a given subtemplate structure identifier.
|
protected java.util.SortedSet<java.lang.String> |
subTemplateStructureIdentifiers
The list of all subtemplate structure identifiers
|
protected SubTemplateStructureMap |
subTemplateStructureMap
The map for sub template structure identifier to a list of template beans.
|
protected boolean |
valuePropagationOn
flag for value propagation
|
protected VariableMap |
variableMap
The key-to-value map for variable names and its values.
|
protected java.util.SortedSet<java.lang.String> |
variables
the set of allowed variable names for this bean (determined through the corresponding template).
|
Constructor and Description |
---|
TemplateBean()
Default constructor.
|
TemplateBean(TemplateBean parentBean)
Template bean with a given parent bean 'rootBean' which is used
for value propagation
|
Modifier and Type | Method and Description |
---|---|
TemplateBean |
append(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier)
Appends a new template bean instance for the given subTemplateIdentifier to the list of template beans
for the subTemplateStructureIdentifier.
|
TemplateBean |
append(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier,
TemplateBean parentBean)
Appends a new template bean instance for the given subTemplateIdentifier to the list of template beans
for the subTemplateStructureIdentifier.
|
TemplateBean |
append(java.lang.String subTemplateStructureIdentifier,
TemplateBean bean)
Appends a template bean to the tail of the template bean list for a given subtemplate structure identifier.
|
protected java.lang.StringBuffer |
applyOperator(TextOperatorPart current,
java.lang.StringBuffer buf,
java.lang.StringBuffer opbuf)
Applies
|
TemplateBean |
clear(java.lang.String subTemplateStructureIdentifier)
Clears the list for a given subtemplate structure identifier.
|
protected java.lang.String |
computeSubTemplateStructurePartText(SubTemplateStructurePart part)
Computes the text for a given sub-template structure part of the template
|
protected java.lang.String |
computeVariablePartText(VariablePart part)
Computes the text for a given variable part of the template
|
protected TemplateBean |
createSubTemplate(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier)
Creates a new sub-template instance for a given subTemplateIdentifer in the specified sub-template structure.
|
protected TemplateBean |
createSubTemplate(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier,
TemplateBean parentBean)
Creates a new sub-template instance for a given subTemplateIdentifer in the specified sub-template structure.
|
java.lang.String |
get(java.lang.String variableName)
Returns the value for a given variable name.
|
TemplateBeanList |
getAll(java.lang.String subTemplateStructureIdentifier)
Returns all elements which have been stored for this sub template structure identifier.
|
abstract java.lang.String |
id()
Returns the id of this template bean
|
protected ID2ClassMap |
id2ClassMap(java.lang.String subTemplateStructureIdentifier)
Returns the template ID to class mapping.
|
boolean |
isValuePropagationOn()
Returns true if value propagation is switched on and false, otherwise.
|
protected void |
logAllVariablesWithNullValuesAsErrors()
Logs all variables with null values as errors.
|
TemplateBean |
parent()
Returns the parent bean of this template bean
|
TemplateBean |
prepend(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier)
Prepends a new template bean instance for the given subTemplateIdentifier to the list of template beans
for the subTemplateStructureIdentifier.
|
TemplateBean |
prepend(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier,
TemplateBean parentBean)
Prepends a new template bean instance for the given subTemplateIdentifier to the list of template beans
for the subTemplateStructureIdentifier.
|
TemplateBean |
prepend(java.lang.String subTemplateStructureIdentifier,
TemplateBean bean)
Prepends a template bean to the beginning of the template bean list for a given subtemplate structure identifier.
|
protected void |
putID2ClassMap(java.lang.String subTemplateStructureIdentifier,
ID2ClassMap map)
Sets the ID class map for a given subtemplate structure identifier.
|
TemplateBean |
set(java.lang.String variableName,
java.lang.String value)
Sets the value for a given variable name.
|
TemplateBean |
setAll(java.lang.String subTemplateStructureIdentifier,
TemplateBeanList beanList)
Sets the template bean for a given subtemplate structure.
|
TemplateBean |
setSubTemplate(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier)
Sets a subtemplate in generic way.
|
TemplateBean |
setSubTemplate(java.lang.String subTemplateStructureIdentifier,
java.lang.String subTemplateIdentifier,
TemplateBean parentBean)
Sets a subtemplate in generic way.
|
void |
setValuePropagation(boolean value)
Sets the value propagation to the given boolean value.
|
protected TemplateBeanList |
subTemplateParentList(TemplateBean parentBean,
java.lang.String subTemplateStructureIdentifier)
Delivers the appropriate
TemplateBeanList for the given sub template structure identifier
for all possible parents. |
protected TemplateBeanList |
subTemplates(java.lang.String subTemplateStructureIdentifier)
Returns the list of template beans for a given sub-template structure identifier.
|
protected SubTemplateStructureMap |
subTemplateStructureMap()
Returns the sub-template structure map of this template bean.
|
java.lang.String |
toString()
Creates the text representation of the template bean
with all inserted values.
|
void |
turnValuePropagationOff()
Turns value propagation off
|
void |
turnValuePropagationOn()
Turns value propagation on.
|
protected TemplateBeanList |
typeConvertedSubTemplates(TemplateBeanList list,
java.lang.String subTemplateStructureIdentifier)
Converts the types a list of template beans to those which are expected
for the given sub template structure identifier.
|
protected VariableMap |
variableMap()
Returns the map with variable values for this template bean.
|
protected java.lang.String |
variableValue(java.lang.String variableName)
Returns the variable value for a given variable name.
|
protected TemplateBean parent
protected boolean valuePropagationOn
protected VariableMap variableMap
protected java.util.SortedSet<java.lang.String> variables
protected SubTemplateStructureMap subTemplateStructureMap
protected SubTemplateStructureID2ClassMap subTemplateStructureID2ClassMap
protected java.util.SortedSet<java.lang.String> subTemplateStructureIdentifiers
protected java.util.List<BeanPart> partList
public TemplateBean()
public TemplateBean(TemplateBean parentBean)
parentBean
- parent beanpublic abstract java.lang.String id()
public TemplateBean parent()
public java.lang.String get(java.lang.String variableName)
variableName
- variable name stringpublic TemplateBean set(java.lang.String variableName, java.lang.String value)
variableName
- variable namevalue
- value for variablepublic TemplateBean setSubTemplate(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier)
subTemplateStructureIdentifier
- identifier for the subtemplate structuresubTemplateIdentifier
- identifier for the subtemplate (i.e. the name of the inline subtemplate or the filename of the external subtemplate)public TemplateBean setSubTemplate(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier, TemplateBean parentBean)
subTemplateStructureIdentifier
- identifier for the subtemplate structuresubTemplateIdentifier
- identifier for the subtemplate (i.e. the name of the inline subtemplate or the filename of the external subtemplate)parentBean
- the parent bean referencepublic TemplateBeanList getAll(java.lang.String subTemplateStructureIdentifier)
subTemplateStructureIdentifier
- identifierpublic TemplateBean setAll(java.lang.String subTemplateStructureIdentifier, TemplateBeanList beanList)
subTemplateStructureIdentifier
- the identifier of the subtemplate structurebeanList
- the list of template beanspublic TemplateBean clear(java.lang.String subTemplateStructureIdentifier)
subTemplateStructureIdentifier
- the identifier for a subtemplate structurepublic TemplateBean prepend(java.lang.String subTemplateStructureIdentifier, TemplateBean bean)
subTemplateStructureIdentifier
- the given identifierbean
- the template beanpublic TemplateBean prepend(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier)
subTemplateStructureIdentifier
- the identifier for the sub-template structuresubTemplateIdentifier
- the identifier for sub-template for which the corresponding class is created.public TemplateBean prepend(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier, TemplateBean parentBean)
subTemplateStructureIdentifier
- the identifier for the sub-template structuresubTemplateIdentifier
- the identifier for sub-template for which the corresponding class is created.parentBean
- the reference to parent beanpublic TemplateBean append(java.lang.String subTemplateStructureIdentifier, TemplateBean bean)
subTemplateStructureIdentifier
- the given identifierbean
- the template beanpublic TemplateBean append(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier)
subTemplateStructureIdentifier
- the identifier for the sub-template structuresubTemplateIdentifier
- the identifier for sub-template for which the corresponding class is created.public TemplateBean append(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier, TemplateBean parentBean)
subTemplateStructureIdentifier
- the identifier for the sub-template structuresubTemplateIdentifier
- the identifier for sub-template for which the corresponding class is created.parentBean
- reference to parent beanpublic boolean isValuePropagationOn()
public void setValuePropagation(boolean value)
value
- true/false for value propagation status.public void turnValuePropagationOn()
public void turnValuePropagationOff()
public java.lang.String toString()
toString
in class java.lang.Object
protected java.lang.String variableValue(java.lang.String variableName)
variableName
- variable nameprotected TemplateBeanList subTemplateParentList(TemplateBean parentBean, java.lang.String subTemplateStructureIdentifier)
TemplateBeanList
for the given sub template structure identifier
for all possible parents.parentBean
- parent tempalte beansubTemplateStructureIdentifier
- identifierprotected TemplateBeanList typeConvertedSubTemplates(TemplateBeanList list, java.lang.String subTemplateStructureIdentifier)
list
- the list of template beanssubTemplateStructureIdentifier
- the identifier for the sub template structureprotected TemplateBeanList subTemplates(java.lang.String subTemplateStructureIdentifier)
subTemplateStructureIdentifier
- sub structure identifierprotected VariableMap variableMap()
protected SubTemplateStructureMap subTemplateStructureMap()
protected TemplateBean createSubTemplate(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier, TemplateBean parentBean)
subTemplateStructureIdentifier
- the identifier of the sub-template structuresubTemplateIdentifier
- the identifier for the subtemplateparentBean
- the reference to the parent beanprotected TemplateBean createSubTemplate(java.lang.String subTemplateStructureIdentifier, java.lang.String subTemplateIdentifier)
subTemplateStructureIdentifier
- the identifier of the sub-template structuresubTemplateIdentifier
- the identifier for the subtemplateprotected ID2ClassMap id2ClassMap(java.lang.String subTemplateStructureIdentifier)
sub
- template structure identifierprotected void putID2ClassMap(java.lang.String subTemplateStructureIdentifier, ID2ClassMap map)
subTemplateStructureIdentifier
- the identifier for the substructuremap
- ID to template bean class mapprotected java.lang.StringBuffer applyOperator(TextOperatorPart current, java.lang.StringBuffer buf, java.lang.StringBuffer opbuf)
current
- TextOperatorPart
buf
- text to be operated onopbuf
- operator string bufferprotected java.lang.String computeVariablePartText(VariablePart part)
part
- the variable partprotected java.lang.String computeSubTemplateStructurePartText(SubTemplateStructurePart part)
part
- the variable partprotected void logAllVariablesWithNullValuesAsErrors()