org.thymeleaf.dialect
Interface IDialect

All Known Implementing Classes:
AbstractDialect, AbstractXHTMLEnabledDialect, StandardDialect

public interface IDialect

Interface for all Thymeleaf Dialects.

A Dialect must define:

A template engine can be specified more than one dialect (each with its processors). In that case, dialects are first checked for conflicts so that, for example, they do not declare DOCTYPE translations or resolution entries conflicting with the ones in other dialect/s (although they can be equal).

Since:
1.0
Author:
Daniel Fernández

Method Summary
 java.util.Set<IDocTypeResolutionEntry> getDocTypeResolutionEntries()
           Returns the set of DOCTYPE resolution entries.
 java.util.Set<IDocTypeTranslation> getDocTypeTranslations()
           Returns the set of DOCTYPE translations.
 java.util.Map<String,Object> getExecutionAttributes()
           Returns the execution attributes that will be set during executions of the template engine.
 String getPrefix()
           Returns the default dialect prefix (the one that will be used if none is explicitly specified during dialect configuration).
 java.util.Set<IProcessor> getProcessors()
           Returns the set of processors.
 boolean isLenient()
           Returns whether the dialect is lenient or not.
 

Method Detail

getPrefix

String getPrefix()

Returns the default dialect prefix (the one that will be used if none is explicitly specified during dialect configuration).

If null is returned, then every attribute and/or element is considered processable by the processors in the dialect that apply to that kind of node (elements with their attributes), and not only those that start with a specific prefix.

Prefixes are not exclusive to a dialect: several dialects can declare the same prefix, effectively acting as an aggregate dialect.

Returns:
the dialect prefix.

isLenient

boolean isLenient()

Returns whether the dialect is lenient or not. If the dialect is not lenient, then after execution of a template no attributes or elements should exist in the result with the prefix specified by this dialect (an error is raised if such thing happens).

For non-lenient dialects, any xmlns:{prefix} attributes in the document root or any other element will be removed from output. These attributes will not be removed for lenient dialects.

When several dialects act on the same prefix, a prefix will be considered to be lenient if any of the dialects for that prefix is lenient.

Unless it is really required (for instance, in dialects with null prefix), dialects should be non-lenient.

Returns:
true if the dialect is lenient, false if not.

getProcessors

java.util.Set<IProcessor> getProcessors()

Returns the set of processors.

Returns:
the set of processors.

getExecutionAttributes

java.util.Map<String,Object> getExecutionAttributes()

Returns the execution attributes that will be set during executions of the template engine.

If more than one dialect are set, all of their execution attributes will be added to the available execution attributes map.

Returns:
the execution attributes for this dialect.
Since:
1.1

getDocTypeTranslations

java.util.Set<IDocTypeTranslation> getDocTypeTranslations()

Returns the set of DOCTYPE translations.

Returns:
the set of DOCTYPE translations.

getDocTypeResolutionEntries

java.util.Set<IDocTypeResolutionEntry> getDocTypeResolutionEntries()

Returns the set of DOCTYPE resolution entries.

Returns:
the set of DOCTYPE resolution entries.


Copyright © 2012 The THYMELEAF team. All Rights Reserved.