Package com.github.jknack.handlebars
Enum TagType
- java.lang.Object
-
- java.lang.Enum<TagType>
-
- com.github.jknack.handlebars.TagType
-
- All Implemented Interfaces:
Serializable
,Comparable<TagType>
public enum TagType extends Enum<TagType>
Tags are indicated by the double mustaches.- Since:
- 0.12.0
-
-
Enum Constant Summary
Enum Constants Enum Constant Description AMP_VAR
All variables are HTML escaped by default.SECTION
Sections render blocks of text one or more times, depending on the value of the key in the current context.STAR_VAR
A var decorator tag, like:{{*name}}
.START_SECTION
Like {{#* decorator}}success{{/decorator}}.SUB_EXPRESSION
Same asVAR
but can be invoked from inside a helper:{{helper (subexpression)}}
.TRIPLE_VAR
All variables are HTML escaped by default.VAR
The most basic tag type is the variable.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
inline()
True for inline tags.static TagType
valueOf(String name)
Returns the enum constant of this type with the specified name.static TagType[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
VAR
public static final TagType VAR
The most basic tag type is the variable. A{{name}}
tag in a basic template will try to find the name key in the current context. If there is no name key, nothing will be rendered.
-
STAR_VAR
public static final TagType STAR_VAR
A var decorator tag, like:{{*name}}
.
-
AMP_VAR
public static final TagType AMP_VAR
All variables are HTML escaped by default. If you want to return unescaped HTML, use the triple mustache:{{&name}}
.
-
TRIPLE_VAR
public static final TagType TRIPLE_VAR
All variables are HTML escaped by default. If you want to return unescaped HTML, use the triple mustache:{{{name}}}
.
-
SUB_EXPRESSION
public static final TagType SUB_EXPRESSION
Same asVAR
but can be invoked from inside a helper:{{helper (subexpression)}}
.
-
SECTION
public static final TagType SECTION
Sections render blocks of text one or more times, depending on the value of the key in the current context.
A section begins with a pound and ends with a slash. That is, {{#person}} begins a "person" section while {{/person}} ends it.
-
START_SECTION
public static final TagType START_SECTION
Like {{#* decorator}}success{{/decorator}}.
-
-
Method Detail
-
values
public static TagType[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:for (TagType c : TagType.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static TagType valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is null
-
inline
public boolean inline()
True for inline tags.- Returns:
- True for inline tags.
-
-