|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object org.thymeleaf.Arguments
public final class Arguments
Objects of this class contain all the required arguments for template processing.
These objects are created internally by the Template Engine in order to provide processors with all the information they might need for performing their tasks.
Arguments include many attributes, among which some should be used internally only, and never by developers of attribute/element processors. Public attributes are:
Configuration
): getConfiguration()
getTemplateName()
IContext
): getContext()
getIdCounts()
getExpressionEvaluationRoot()
getExpressionSelectionEvaluationRoot()
Method Summary | |
---|---|
Arguments |
addLocalVariables(java.util.Map<String,Object> newVariables)
Creates a new Arguments object by adding some new local variables to the existing map (the rest of the attributes are copied verbatim). |
Arguments |
addLocalVariablesAndProcessOnlyElementNodes(java.util.Map<String,Object> newVariables,
boolean shouldProcessOnlyElementNodes)
Creates a new Arguments object by setting new local variables and a new value for the processOnlyElementNodes flag. |
Arguments |
addLocalVariablesAndProcessOnlyElementNodesAndSetSelectionTarget(java.util.Map<String,Object> newVariables,
boolean shouldProcessOnlyElementNodes,
Object target)
Creates a new Arguments object by adding new local variables, a new value for the processOnlyElementNodes flag and a selection target. |
Arguments |
addLocalVariablesAndSetSelectionTarget(java.util.Map<String,Object> newVariables,
Object target)
Creates a new Arguments object by setting new local variables and a selection target. |
Integer |
getAndIncrementIDSeq(String id)
Returns a new index (ID count) for a specific value of the id attribute, and increments the count. |
java.util.Map<String,Object> |
getBaseContextVariables()
Returns the map of base variables that should be made available to every expression evaluation operation (whenever variable evaluation is available). |
Configuration |
getConfiguration()
Returns the Template Engine configuration being used for processing templates. |
IContext |
getContext()
Returns the current context specified for template processing. |
Document |
getDocument()
Returns the parsed Document DOM object. |
Object |
getExecutionAttribute(String attributeName)
Returns the execution attribute with the specified name. |
java.util.Map<String,Object> |
getExecutionAttributes()
Returns the execution attributes. |
Object |
getExpressionEvaluationRoot()
Returns the current evaluation root. |
Object |
getExpressionSelectionEvaluationRoot()
Returns the current selection evaluation root. |
java.util.Map<String,Integer> |
getIdCounts()
Returns the map of ID counts. |
Object |
getLocalVariable(String variableName)
Returns the value of a local variable. |
java.util.Map<String,Object> |
getLocalVariables()
Returns a safe copy of the map of local variables. |
Integer |
getNextIDSeq(String id)
Returns the index (ID count) for a specific value of the id attribute without incrementing the count. |
Integer |
getPreviousIDSeq(String id)
Returns the last index (ID count) returned for a specific value of the id attribute (without incrementing the count). |
boolean |
getProcessOnlyElementNodes()
Returns whether only element nodes should be processed (as opposed to texts, CDATAs, comments, etc.). |
org.thymeleaf.Arguments.SelectionTarget |
getSelectionTarget()
Returns the current selection target (e.g. object selected by a th:object attribute in standard dialect). |
Object |
getSelectionTargetObject()
Returns the selection target object, object contained by the result of getSelectionTarget() , and raises an
exception if there isn't any. |
String |
getTemplateName()
Returns the name of the template currently being processed. |
TemplateProcessingParameters |
getTemplateProcessingParameters()
Returns the Template Processing Parameters used for resolving and parsing the template being processed. |
TemplateRepository |
getTemplateRepository()
Returns the template repository in use. |
TemplateResolution |
getTemplateResolution()
Returns the template resolution object corresponding to the template currently being processed. |
boolean |
hasLocalVariable(String variableName)
Returns whether a specific local variable is defined or not. |
boolean |
hasLocalVariables()
Returns whether local variables have currently been specified or not. |
boolean |
hasSelectionTarget()
Returns whether there currently is a selection going on (e.g. |
Arguments |
setProcessOnlyElementNodes(boolean shouldProcessOnlyElementNodes)
Creates a new Arguments object by setting a new value for the processOnlyElementNodes flag. |
Arguments |
setProcessOnlyElementNodesAndSetSelectionTarget(boolean shouldProcessOnlyElementNodes,
Object target)
Creates a new Arguments object by setting a new value for the processOnlyElementNodes flag and a selection target. |
Arguments |
setSelectionTarget(Object target)
Creates a new Arguments object by setting a selection target. |
java.util.HashMap<String,Object> |
unsafeGetLocalVariables()
Returns the real inner map of local variables. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public TemplateProcessingParameters getTemplateProcessingParameters()
Returns the Template Processing Parameters used for resolving and parsing the template being processed.
public Configuration getConfiguration()
Returns the Template Engine configuration being used for processing templates.
public TemplateResolution getTemplateResolution()
Returns the template resolution object corresponding to the template currently being processed.
public TemplateRepository getTemplateRepository()
Returns the template repository in use.
public Document getDocument()
Returns the parsed Document DOM object.
public String getTemplateName()
Returns the name of the template currently being processed.
public IContext getContext()
Returns the current context specified for template processing.
public boolean hasLocalVariables()
Returns whether local variables have currently been specified or not. (e.g. th:with in standard dialect).
public Object getLocalVariable(String variableName)
Returns the value of a local variable.
variableName
- the name of the local variable to be returned
public boolean hasLocalVariable(String variableName)
Returns whether a specific local variable is defined or not.
public java.util.HashMap<String,Object> unsafeGetLocalVariables()
Returns the real inner map of local variables. This method should not be called directly.
public java.util.Map<String,Object> getLocalVariables()
Returns a safe copy of the map of local variables.
public boolean getProcessOnlyElementNodes()
Returns whether only element nodes should be processed (as opposed to texts, CDATAs, comments, etc.). Default is true.
public boolean hasSelectionTarget()
Returns whether there currently is a selection going on (e.g. th:object in standard dialect).
public org.thymeleaf.Arguments.SelectionTarget getSelectionTarget()
Returns the current selection target (e.g. object selected by a th:object attribute in standard dialect).
public Object getSelectionTargetObject()
Returns the selection target object, object contained
by the result of getSelectionTarget()
, and raises an
exception if there isn't any.
Meant for internal use.
public java.util.Map<String,Integer> getIdCounts()
Returns the map of ID counts.
These numbers are used to avoid conflicts among elements with the same id attribute; for example elements being repeated as a part of a th:each iteration.
public java.util.Map<String,Object> getExecutionAttributes()
Returns the execution attributes.
public Object getExecutionAttribute(String attributeName)
Returns the execution attribute with the specified name.
attributeName
- the name of the attribute to be retrieved
public Object getExpressionEvaluationRoot()
Returns the current evaluation root. This is the object on which expressions (normal expressions, like those specified in the standard dialect with ${...}) are executed.
public Object getExpressionSelectionEvaluationRoot()
Returns the current selection evaluation root. This is the object on which selection expressions (like those specified in the standard dialect with *{...}) are executed.
public java.util.Map<String,Object> getBaseContextVariables()
Returns the map of base variables that should be made available to every expression evaluation operation (whenever variable evaluation is available).
public Integer getAndIncrementIDSeq(String id)
Returns a new index (ID count) for a specific value of the id attribute, and increments the count.
id
- the ID for which the count will be computed
public Integer getNextIDSeq(String id)
Returns the index (ID count) for a specific value of the id attribute without incrementing the count.
id
- the ID for which the count will be retrieved
public Integer getPreviousIDSeq(String id)
Returns the last index (ID count) returned for a specific value of the id attribute (without incrementing the count).
id
- the ID for which the last count will be retrieved
public Arguments addLocalVariables(java.util.Map<String,Object> newVariables)
Creates a new Arguments object by adding some new local variables to the existing map (the rest of the attributes are copied verbatim).
newVariables
- the new variables
public Arguments setSelectionTarget(Object target)
Creates a new Arguments object by setting a selection target.
target
- the new selection target object
public Arguments addLocalVariablesAndSetSelectionTarget(java.util.Map<String,Object> newVariables, Object target)
Creates a new Arguments object by setting new local variables and a selection target.
newVariables
- the new local variablestarget
- the new selection target object
public Arguments setProcessOnlyElementNodes(boolean shouldProcessOnlyElementNodes)
Creates a new Arguments object by setting a new value for the processOnlyElementNodes flag.
shouldProcessOnlyElementNodes
- whether only element nodes should be processed from this moment in template execution
public Arguments addLocalVariablesAndProcessOnlyElementNodes(java.util.Map<String,Object> newVariables, boolean shouldProcessOnlyElementNodes)
Creates a new Arguments object by setting new local variables and a new value for the processOnlyElementNodes flag.
newVariables
- the new local variablesshouldProcessOnlyElementNodes
- whether only element nodes should be processed from this moment in template execution
public Arguments setProcessOnlyElementNodesAndSetSelectionTarget(boolean shouldProcessOnlyElementNodes, Object target)
Creates a new Arguments object by setting a new value for the processOnlyElementNodes flag and a selection target.
shouldProcessOnlyElementNodes
- whether only element nodes should be processed from this moment in template executiontarget
- the new selection target object
public Arguments addLocalVariablesAndProcessOnlyElementNodesAndSetSelectionTarget(java.util.Map<String,Object> newVariables, boolean shouldProcessOnlyElementNodes, Object target)
Creates a new Arguments object by adding new local variables, a new value for the processOnlyElementNodes flag and a selection target.
newVariables
- the new local variablesshouldProcessOnlyElementNodes
- whether only element nodes should be processed from this moment in template executiontarget
- the new selection target object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |