|
||||||||||
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 to processors (attribute, tag or value) 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/tag/value processors. Public attributes are:
Configuration
): getConfiguration()
getTemplateName()
IContext
): getContext()
TemplateParser
): getTemplateParser()
getIdCounts()
getExpressionEvaluationRoot()
getExpressionSelectionEvaluationRoot()
ITextInliner
, if it exists: getTextInliner()
Constructor Summary | |
---|---|
Arguments(Configuration configuration,
TemplateParser templateParser,
String templateName,
IContext context)
Create a new Arguments instance. |
|
Arguments(Configuration configuration,
TemplateParser templateParser,
String templateName,
IContext context,
Map<String,Object> localVariables,
org.thymeleaf.Arguments.SelectionTarget selectionTarget,
Map<String,Integer> idCounts,
ITextInliner textInliner)
Create a new Arguments instance. |
Method Summary | |
---|---|
Arguments |
addLocalVariables(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 |
addLocalVariablesAndSetSelectionTarget(Map<String,Object> newVariables,
Object target)
Creates a new Arguments object by setting new local variables and a selection target. |
Arguments |
addLocalVariablesAndTextInliner(Map<String,Object> newVariables,
ITextInliner newTextInliner)
Creates a new Arguments object by setting new local variables and a new text inliner. |
Arguments |
addLocalVariablesAndTextInlinerAndSetSelectionTarget(Map<String,Object> newVariables,
ITextInliner newTextInliner,
Object target)
Creates a new Arguments object by adding new local variables, a text inliner 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. |
Configuration |
getConfiguration()
Returns the Template Engine configuration being used for processing templates. |
IContext |
getContext()
Returns the current context specified for template processing. |
Object |
getExpressionEvaluationRoot()
Returns the current evaluation root. |
Object |
getExpressionSelectionEvaluationRoot()
Returns the current selection evaluation root. |
Map<String,Integer> |
getIdCounts()
Returns the map of ID counts. |
Object |
getLocalVariable(String variableName)
Returns the value of a local variable. |
Map<String,Object> |
getLocalVariables()
Returns 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). |
org.thymeleaf.Arguments.SelectionTarget |
getSelectionTarget()
Returns the current selection target (e.g. |
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. |
TemplateParser |
getTemplateParser()
Returns the template parser being used for parsing templates. |
ITextInliner |
getTextInliner()
Returns the currently set text inliner (if any). |
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. |
boolean |
hasTextInliner()
Returns whether a text inliner has been set for the fragment of code currently being processed (e.g. |
Arguments |
setSelectionTarget(Object target)
Creates a new Arguments object by setting a selection target. |
Arguments |
setTextInliner(ITextInliner newTextInliner)
Creates a new Arguments object by setting a new text inliner. |
Arguments |
setTextInlinerAndSetSelectionTarget(ITextInliner newTextInliner,
Object target)
Creates a new Arguments object by setting a new text inliner and a selection target. |
Methods inherited from class Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Arguments(Configuration configuration, TemplateParser templateParser, String templateName, IContext context)
Create a new Arguments instance.
Mainly for internal use. Should not be called directly except
when processing a template (e.g. a fragment) using the TemplateEngine
from a tag/attribute processor.
configuration
- the configurationtemplateParser
- the template parsertemplateName
- the template namecontext
- the contextpublic Arguments(Configuration configuration, TemplateParser templateParser, String templateName, IContext context, Map<String,Object> localVariables, org.thymeleaf.Arguments.SelectionTarget selectionTarget, Map<String,Integer> idCounts, ITextInliner textInliner)
Create a new Arguments instance.
Mainly for internal use. Should not be called directly except
when processing a template (e.g. a fragment) using the TemplateEngine
from a tag/attribute processor.
configuration
- the configurationtemplateParser
- the template parsertemplateName
- the template namecontext
- the contextlocalVariables
- the local variablesselectionTarget
- the selection targetidCounts
- the map of ID countstextInliner
- the text inliner (if any, can be null)Method Detail |
---|
public Configuration getConfiguration()
Returns the Template Engine configuration being used for processing templates.
public TemplateParser getTemplateParser()
Returns the template parser being used for parsing templates.
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 Map<String,Object> getLocalVariables()
Returns the map of local variables.
public boolean hasTextInliner()
Returns whether a text inliner has been set for the fragment of code currently being processed (e.g. with th:inline in standard dialect).
public ITextInliner getTextInliner()
Returns the currently set text inliner (if any).
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 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 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 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(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(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 setTextInliner(ITextInliner newTextInliner)
Creates a new Arguments object by setting a new text inliner.
newTextInliner
- the new text inliner
public Arguments addLocalVariablesAndTextInliner(Map<String,Object> newVariables, ITextInliner newTextInliner)
Creates a new Arguments object by setting new local variables and a new text inliner.
newVariables
- the new local variablesnewTextInliner
- the new text inliner
public Arguments setTextInlinerAndSetSelectionTarget(ITextInliner newTextInliner, Object target)
Creates a new Arguments object by setting a new text inliner and a selection target.
newTextInliner
- the new text inlinertarget
- the new selection target object
public Arguments addLocalVariablesAndTextInlinerAndSetSelectionTarget(Map<String,Object> newVariables, ITextInliner newTextInliner, Object target)
Creates a new Arguments object by adding new local variables, a text inliner and a selection target.
newVariables
- the new local variablesnewTextInliner
- the new text inlinertarget
- the new selection target object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |