Class StandardDialect
- All Implemented Interfaces:
IDialect
,IExecutionAttributeDialect
,IExpressionObjectDialect
,IProcessorDialect
Standard Dialect. This is the class containing the implementation of Thymeleaf Standard Dialect, including all
th:*
processors, expression objects, etc.
Note this dialect uses OGNL as an expression language. There is a Spring-integrated version
of the Standard Dialect called the SpringStandard Dialect at the thymeleaf-spring*
packages,
which uses SpringEL as an expression language.
Note a class with this name existed since 1.0, but it was completely reimplemented in Thymeleaf 3.0
- Since:
- 3.0.0
- Author:
- Daniel Fernández
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected IStandardConversionService
protected IStandardCSSSerializer
protected IExpressionObjectFactory
protected IStandardExpressionParser
protected IStandardJavaScriptSerializer
static final String
static final String
static final int
protected IStandardVariableExpressionEvaluator
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
StandardDialect
(String name, String prefix, int processorPrecedence) -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<IProcessor>
createStandardProcessorsSet
(String dialectPrefix) Create a the set of Standard processors, all of them freshly instanced.Returns the Standard Conversion Service (implementation ofIStandardConversionService
) that is configured to be used at this instance of the Standard Dialect.Returns the Standard CSS Serializer (implementation ofIStandardCSSSerializer
) that is configured to be used at this instance of the Standard Dialect.Returns the Thymeleaf Standard Expression parser (implementation ofIStandardExpressionParser
) that is configured to be used at this instance of the Standard Dialect.Returns the Standard JavaScript Serializer (implementation ofIStandardJavaScriptSerializer
) that is configured to be used at this instance of the Standard Dialect.getProcessors
(String dialectPrefix) Returns the variable expression evaluator (implementation ofIStandardVariableExpressionEvaluator
) that is configured to be used at this instance of the Standard Dialect.void
setConversionService
(IStandardConversionService conversionService) Sets the Standard Conversion Service (implementation ofIStandardConversionService
) that should to be used at this instance of the Standard Dialect.void
setCSSSerializer
(IStandardCSSSerializer cssSerializer) Sets the Standard CSS Serializer (implementation ofIStandardCSSSerializer
) that should to be used at this instance of the Standard Dialect.void
setExpressionParser
(IStandardExpressionParser expressionParser) Sets the Thymeleaf Standard Expression parser (implementation ofIStandardExpressionParser
) that should be used at this instance of the Standard Dialect.void
setJavaScriptSerializer
(IStandardJavaScriptSerializer javaScriptSerializer) Sets the Standard JavaScript Serializer (implementation ofIStandardJavaScriptSerializer
) that should to be used at this instance of the Standard Dialect.void
setVariableExpressionEvaluator
(IStandardVariableExpressionEvaluator variableExpressionEvaluator) Sets the variable expression evaluator (implementation ofIStandardVariableExpressionEvaluator
) that should be used at this instance of the Standard Dialect.Methods inherited from class org.thymeleaf.dialect.AbstractProcessorDialect
getDialectProcessorPrecedence, getPrefix
Methods inherited from class org.thymeleaf.dialect.AbstractDialect
getName
-
Field Details
-
NAME
- See Also:
-
PREFIX
- See Also:
-
PROCESSOR_PRECEDENCE
public static final int PROCESSOR_PRECEDENCE- See Also:
-
variableExpressionEvaluator
-
expressionParser
-
conversionService
-
javaScriptSerializer
-
cssSerializer
-
expressionObjectFactory
-
-
Constructor Details
-
StandardDialect
public StandardDialect() -
StandardDialect
-
-
Method Details
-
getVariableExpressionEvaluator
Returns the variable expression evaluator (implementation of
IStandardVariableExpressionEvaluator
) that is configured to be used at this instance of the Standard Dialect.This is used for executing all ${...} and *{...} expressions in Thymeleaf Standard Expressions.
This will be
OGNLVariableExpressionEvaluator
by default. When using the Spring Standard Dialect, this will be a SpringEL-based implementation.- Returns:
- the Standard Variable Expression Evaluator object.
-
setVariableExpressionEvaluator
public void setVariableExpressionEvaluator(IStandardVariableExpressionEvaluator variableExpressionEvaluator) Sets the variable expression evaluator (implementation of
IStandardVariableExpressionEvaluator
) that should be used at this instance of the Standard Dialect.This is used for executing all ${...} and *{...} expressions in Thymeleaf Standard Expressions.
This will be an
OGNLVariableExpressionEvaluator
by default. When using the Spring Standard Dialect, this will be a SpringEL-based implementation.This method has no effect once the Template Engine has been initialized.
Objects set here should be thread-safe.
- Parameters:
variableExpressionEvaluator
- the new Standard Variable Expression Evaluator object. Cannot be null.
-
getExpressionParser
Returns the Thymeleaf Standard Expression parser (implementation of
IStandardExpressionParser
) that is configured to be used at this instance of the Standard Dialect.This will be
StandardExpressionParser
by default.- Returns:
- the Standard Expression Parser object.
-
setExpressionParser
Sets the Thymeleaf Standard Expression parser (implementation of
IStandardExpressionParser
) that should be used at this instance of the Standard Dialect.This will be
StandardExpressionParser
by default.This method has no effect once the Template Engine has been initialized.
Objects set here should be thread-safe.
- Parameters:
expressionParser
- the Standard Expression Parser object to be used. Cannot be null.
-
getConversionService
Returns the Standard Conversion Service (implementation of
IStandardConversionService
) that is configured to be used at this instance of the Standard Dialect.This will be
StandardConversionService
by default. In Spring environments, this will default to an implementation delegating on Spring's own ConversionService implementation.- Returns:
- the Standard Conversion Service object.
-
setConversionService
Sets the Standard Conversion Service (implementation of
IStandardConversionService
) that should to be used at this instance of the Standard Dialect.This will be
StandardConversionService
by default. In Spring environments, this will default to an implementation delegating on Spring's own ConversionService implementation.This method has no effect once the Template Engine has been initialized.
Objects set here should be thread-safe.
- Parameters:
conversionService
- the Standard ConversionService object to be used. Cannot be null.
-
getJavaScriptSerializer
Returns the Standard JavaScript Serializer (implementation of
IStandardJavaScriptSerializer
) that is configured to be used at this instance of the Standard Dialect.This will be
StandardJavaScriptSerializer
by default.- Returns:
- the Standard JavaScript Serializer object.
-
setJavaScriptSerializer
Sets the Standard JavaScript Serializer (implementation of
IStandardJavaScriptSerializer
) that should to be used at this instance of the Standard Dialect.This will be
StandardJavaScriptSerializer
by default.This method has no effect once the Template Engine has been initialized.
Objects set here should be thread-safe.
- Parameters:
javaScriptSerializer
- the Standard JavaScript Serializer object to be used. Cannot be null.
-
getCSSSerializer
Returns the Standard CSS Serializer (implementation of
IStandardCSSSerializer
) that is configured to be used at this instance of the Standard Dialect.This will be
StandardCSSSerializer
by default.- Returns:
- the Standard CSS Serializer object.
-
setCSSSerializer
Sets the Standard CSS Serializer (implementation of
IStandardCSSSerializer
) that should to be used at this instance of the Standard Dialect.This will be
StandardCSSSerializer
by default.This method has no effect once the Template Engine has been initialized.
Objects set here should be thread-safe.
- Parameters:
cssSerializer
- the Standard CSS Serializer object to be used. Cannot be null.
-
getExecutionAttributes
- Specified by:
getExecutionAttributes
in interfaceIExecutionAttributeDialect
-
getExpressionObjectFactory
- Specified by:
getExpressionObjectFactory
in interfaceIExpressionObjectDialect
-
getProcessors
- Specified by:
getProcessors
in interfaceIProcessorDialect
-
createStandardProcessorsSet
Create a the set of Standard processors, all of them freshly instanced.
- Parameters:
dialectPrefix
- the prefix established for the Standard Dialect, needed for initialization- Returns:
- the set of Standard processors.
-