- Enclosing class:
Mustache
public static interface Mustache.Visitor
Used to visit the tags in a template without executing it.
-
Method Summary
Modifier and TypeMethodDescriptiondefault boolean
visitBlock
(String name) Visits a block tag.boolean
visitInclude
(String name) Visits an include (partial) tag.boolean
visitInvertedSection
(String name) Visits an inverted section tag.default boolean
visitParent
(String name) Visits a parent partial tag.boolean
visitSection
(String name) Visits a section tag.void
Visits a text segment.void
visitVariable
(String name) Visits a variable tag.
-
Method Details
-
visitText
Visits a text segment. These are blocks of text that are normally just reproduced as is when executing a template.- Parameters:
text
- the block of text. May contain newlines.
-
visitVariable
Visits a variable tag.- Parameters:
name
- the name of the variable.
-
visitInclude
Visits an include (partial) tag.- Parameters:
name
- the name of the partial template specified by the tag.- Returns:
- true if the template should be resolved and visited, false to skip it.
-
visitParent
Visits a parent partial tag. For backward compatibility by defaultfalse
is returned.- Parameters:
name
- the name of the parent partial template specified by the tag.- Returns:
- true if the template should be resolved and visited, false to skip it.
-
visitBlock
Visits a block tag. For backward compatibility by default is skipped.- Parameters:
name
- the name of the block.- Returns:
- true if the contents of the block should be visited, false to skip.
-
visitSection
Visits a section tag.- Parameters:
name
- the name of the section.- Returns:
- true if the contents of the section should be visited, false to skip.
-
visitInvertedSection
Visits an inverted section tag.- Parameters:
name
- the name of the inverted section.- Returns:
- true if the contents of the section should be visited, false to skip.
-