Index
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form
A
- access(T, String) - Method in interface org.klojang.templates.Accessor
-
Returns the value identified by the specified name from the specified source data object.
- ACCESS_EXCEPTION - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
An error occurred while retrieving the value for a template variable.
- Accessor<T> - Interface in org.klojang.templates
-
Accessors are used to extract values from objects.
- AccessorRegistry - Class in org.klojang.templates
-
A registry of accessors.
- AccessorRegistry.Builder - Class in org.klojang.templates
-
A builder class for
AccessorRegistry
instances. - AS_IS - Static variable in interface org.klojang.templates.NameMapper
-
The no-op name mapper.
- ATTR - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
attr:
prefix.
B
- BEGIN_TAG_NOT_TERMINATED - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The character sequence
~%%begin:
was found, but no terminating percentage-sign (%
) followed.
C
- camelCaseToSnakeLowerCase() - Static method in class org.klojang.templates.name.CamelCaseToSnakeLowerCase
-
Returns an instance of
CamelCaseToSnakeLowerCase
. - CamelCaseToSnakeLowerCase - Class in org.klojang.templates.name
-
Converts camel case identifiers to snake case identifiers.
- CamelCaseToSnakeLowerCase() - Constructor for class org.klojang.templates.name.CamelCaseToSnakeLowerCase
- camelCaseToSnakeUpperCase() - Static method in class org.klojang.templates.name.CamelCaseToSnakeUpperCase
-
Returns an instance of
CamelCaseToSnakeUpperCase
. - CamelCaseToSnakeUpperCase - Class in org.klojang.templates.name
-
Converts camel case identifiers to snake case identifiers.
- CamelCaseToSnakeUpperCase() - Constructor for class org.klojang.templates.name.CamelCaseToSnakeUpperCase
- camelCaseToWordCase() - Static method in class org.klojang.templates.name.CamelCaseToWordCase
-
Returns an instance of
CamelCaseToWordCase
. - CamelCaseToWordCase - Class in org.klojang.templates.name
-
Converts camel case identifiers to word case (a.k.a. pascal case) identifiers.
- CamelCaseToWordCase() - Constructor for class org.klojang.templates.name.CamelCaseToWordCase
- cleanSlate() - Static method in class org.klojang.templates.StringifierRegistry
-
Returns a
Builder
instance that lets you configure aStringifierRegistry
. - clear(String...) - Method in interface org.klojang.templates.RenderSession
-
Depopulates and hides the specified nested templates.
- Conditional Rendering - Search tag in org.klojang.templates.RenderSession.populate(String, Object, String, VarGroup, List<String>)
- Section
- configure() - Static method in class org.klojang.templates.AccessorRegistry
-
Returns a
Builder
object that lets you configure anAccessorRegistry
. - configure() - Static method in class org.klojang.templates.StringifierRegistry
-
Returns a
Builder
instance that lets you configure aStringifierRegistry
. - countNestedTemplates() - Method in class org.klojang.templates.Template
-
Returns the number of templates nested inside this
Template
(non-recursive). - countVariableOccurrences() - Method in class org.klojang.templates.Template
-
Returns the total number of variables in this
Template
.
D
- DANGLING_END_TAG - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
A dangling end-of-template was found.
- DEF - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
def:
prefix. - DEFAULT - Static variable in interface org.klojang.templates.Stringifier
-
A stringifier that stringifies
null
to an empty string and any other value by callingtoString()
on it. - defaultValue() - Method in enum class org.klojang.templates.Setting
-
Returns the default value for this setting.
- disable(String...) - Method in interface org.klojang.templates.RenderSession
-
Explicitly suppresses the rendering of the specified nested text-only templates.
- DITCH_BLOCK_NOT_CLOSED - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
A ditch block was not closed.
- DUPLICATE_TMPL_NAME - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The template contained two or more nested templates with the same name.
E
- enable(int, String...) - Method in interface org.klojang.templates.RenderSession
-
Enables one or more nested text-only templates.
- enable(String...) - Method in interface org.klojang.templates.RenderSession
-
Enables one or more nested text-only templates.
- enable(String, int, String...) - Method in interface org.klojang.templates.RenderSession
-
Enables one or more nested text-only templates.
- enableRecursive(String...) - Method in interface org.klojang.templates.RenderSession
-
Recursively enables one or more nested text-only templates.
- END_TAG_NOT_TERMINATED - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The character sequence
~%%end:
was found, but no terminating percentage-sign (%
) followed. - envVar() - Method in enum class org.klojang.templates.Setting
-
Returns the name of the environment variable for this setting.
- equals(Object) - Method in class org.klojang.templates.Template
-
Determines whether this template is equal to the specified object.
- equals(Object) - Method in record class org.klojang.templates.VariableOccurrence
-
Indicates whether some other object is "equal to" this one.
- ESCAPE_ATTR - Static variable in class org.klojang.templates.StringifierRegistry
-
To be used for escaping HTML attributes.
- ESCAPE_HTML - Static variable in class org.klojang.templates.StringifierRegistry
-
Applies HTML escaping.
- ESCAPE_JS - Static variable in class org.klojang.templates.StringifierRegistry
-
Applies Javascript escaping.
- ESCAPE_JS_ATTR - Static variable in class org.klojang.templates.StringifierRegistry
-
To be used for escaping HTML attributes containing Javascript, like
onclick
. - ESCAPE_PATH - Static variable in class org.klojang.templates.StringifierRegistry
-
To be used for escaping URL path segments.
- ESCAPE_QUERY_PARAM - Static variable in class org.klojang.templates.StringifierRegistry
-
To be used for escaping URL query parameter.
F
- forName(String) - Static method in class org.klojang.templates.VarGroup
-
Returns the
VarGroup
with the specified name (which is also the prefix to be used inside a template). - forName(String, Stringifier) - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Assigns the specified stringifier to all variables with the specified name.
- forTemplate(Template, String, Stringifier, String...) - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Assigns the specified stringifier to one or more variables in a nested template.
- forType(Class<?>, Stringifier) - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Assigns the specified stringifier to the specified type.
- forVarGroup(String, Stringifier) - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Assigns the specified stringifier to the specified variable group.
- freeze() - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Returns an
AccessorRegistry
with the configured accessors. - freeze() - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Returns a new, immutable
StringifierRegistry
instance. - fromFile(String) - Static method in class org.klojang.templates.Template
-
Parses the specified file into a
Template
. - fromResolver(PathResolver, String) - Static method in class org.klojang.templates.Template
-
Creates a
Template
from the source provided by the specifiedPathResolver
. - fromResource(Class<?>, String) - Static method in class org.klojang.templates.Template
-
Parses the specified resource into a
Template
. - fromString(Class<?>, String) - Static method in class org.klojang.templates.Template
-
Parses the specified string into a
Template
. - fromString(String) - Static method in class org.klojang.templates.Template
-
Parses the specified string into a
Template
.
G
- get() - Method in enum class org.klojang.templates.Setting
-
Returns the value of this setting or its default value if not specified.
- getAllUnsetVariables() - Method in interface org.klojang.templates.RenderSession
-
Returns the fully-qualified names of all variables that have not been set yet in the template managed by this
RenderSession
and all templates descending from it. - getAllUnsetVariables(boolean) - Method in interface org.klojang.templates.RenderSession
-
Returns the fully-qualified names of all variables that have not been set yet in the template managed by this
RenderSession
and all templates descending from it. - getAllVariableFQNames(Template) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the fully-qualified names of all variables in the specified template and all templates descending from the specified template.
- getAllVariableFQNames(Template, boolean) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the fully-qualified names of all variables in the specified template and all templates descending from the specified template.
- getAllVariableOccurrences(Template) - Static method in class org.klojang.templates.TemplateUtils
-
Returns a depth-first view of all variable occurrences within the specified template.
- getAllVariables(Template) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the names of all variables in the specified template and all templates descending from the specified template.
- getChildSessions(String) - Method in interface org.klojang.templates.RenderSession
-
Returns the child sessions that have been created for the specified nested template.
- getContainingTemplate(Template, String) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the template that directly contains the variable or nested template denoted by the specified fully-qualified name.
- getErrorCode() - Method in exception class org.klojang.templates.ParseException
-
Returns a
ParseErrorCode
constant identifying the error. - getErrorCode() - Method in exception class org.klojang.templates.RenderException
-
Returns a
RenderErrorCode
constant identifying the error. - getFQN(Template) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the fully-qualified name of the specified template, relative to the root template.
- getFQN(Template, String) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the fully-qualified name of the specified name.
- getName() - Method in class org.klojang.templates.Template
-
Returns the name of this
Template
. - getName() - Method in class org.klojang.templates.VarGroup
-
Returns the name of this
VarGroup
, which is also the prefix to be used inside a template. - getNames() - Method in class org.klojang.templates.Template
-
Returns the names of all variables and nested templates within this
Template
(non-recursive). - getNestedTemplate(String) - Method in class org.klojang.templates.Template
-
Returns the nested template identified by the specified name.
- getNestedTemplate(Template, String) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the nested template corresponding to the specified fully-qualified name.
- getNestedTemplateNames() - Method in class org.klojang.templates.Template
-
Returns the names of all templates nested inside this
Template
(non-recursive). - getNestedTemplates() - Method in class org.klojang.templates.Template
-
Returns all templates nested inside this
Template
(non-recursive). - getParent() - Method in class org.klojang.templates.Template
-
Returns the template inside which this
Template
is nested. - getRootTemplate() - Method in class org.klojang.templates.Template
-
Returns the root template of this (nested)
Template
. - getTemplate() - Method in interface org.klojang.templates.RenderSession
-
Returns the template being populated by this
RenderSession
. - getTemplateHierarchy(Template) - Static method in class org.klojang.templates.TemplateUtils
-
Returns the specified template and all templates descending from it.
- getUnsetVariables() - Method in interface org.klojang.templates.RenderSession
-
Returns all variables that have not been set yet in the template managed by this
RenderSession
. - getVariableOccurrences() - Method in class org.klojang.templates.Template
-
Returns all occurrences of all variables within this
Template
. - getVariables() - Method in class org.klojang.templates.Template
-
Returns the names of the variables in this
Template
, in order of their first appearance in the template.
H
- hashCode() - Method in class org.klojang.templates.Template
-
Returns the hash code of this
Template
. - hashCode() - Method in record class org.klojang.templates.VariableOccurrence
-
Returns a hash code value for this object.
- hasNestedTemplate(String) - Method in class org.klojang.templates.Template
-
Returns
true
if thisTemplate
contains a nested template with the specified name. - hasUnsetVariables() - Method in interface org.klojang.templates.RenderSession
-
Returns
true
if at least one variable has not been set yet in the template managed by thisRenderSession
or any of the templates descending from it. - hasVariable(String) - Method in class org.klojang.templates.Template
-
Returns
true
if thisTemplate
directly contains a variable with the specified name. - hasVariables() - Method in class org.klojang.templates.Template
-
Returns
true
if there is at least one variable in thisTemplate
, or anyTemplate descending
from it. - HTML - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
html:
prefix. - HTML Comment Wrapping - Search tag in module org.klojang.templates
- Section
I
- ifNotSet(String, IntFunction<Object>) - Method in interface org.klojang.templates.RenderSession
-
Sets the specified variable to the value produced by the specified
IntFunction
if the variable has not already been set. - ifNotSet(String, VarGroup, IntFunction<Object>) - Method in interface org.klojang.templates.RenderSession
-
Sets the specified variable to the value produced by the specified
IntFunction
if the variable has not already been set. - ILLEGAL_TMPL_NAME - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The template contained a nested template with an illegal name.
- ILLEGAL_VAR_PREFIX - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The template contained a variable with an illegal group name prefix (most likely "begin" or "end").
- in(String) - Method in interface org.klojang.templates.RenderSession
-
Returns a
RenderSession
for the specified nested template. - INCLUDE_TAG_NOT_TERMINATED - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The character sequence
~%%include:
was found, but no terminating%%
followed. - insert(Object) - Method in interface org.klojang.templates.RenderSession
-
Populates the template with values extracted from the specified object.
- insert(Object, VarGroup, List<String>) - Method in interface org.klojang.templates.RenderSession
-
Populates the template with values from the specified source data object.
- INVALID_INCLUDE_PATH - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The path specified in an included template (e.g.
~%%include:/path/to/foo.html%%
) could not be resolved to a readable resource. - isTextOnly() - Method in class org.klojang.templates.Template
-
Returns
true
if this is a text-only template. - isValidPath(String) - Method in interface org.klojang.templates.PathResolver
-
Returns whether the path specified in an included template (like
~%%include:/path/to/foo.html%%
) points to an existing resource.
J
- JS - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
js:
prefix. - JS_ATTR - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
jsattr:
prefix.
M
- map(String) - Method in class org.klojang.templates.name.CamelCaseToSnakeLowerCase
-
Maps a camel case name to an all-lowercase snake case name.
- map(String) - Method in class org.klojang.templates.name.CamelCaseToSnakeUpperCase
-
Maps a camel case name to an all-uppercase snake case name.
- map(String) - Method in class org.klojang.templates.name.CamelCaseToWordCase
-
Maps a camel case name to a word case name.
- map(String) - Method in class org.klojang.templates.name.SnakeCaseToCamelCase
-
Maps a snake case name to a camel case name.
- map(String) - Method in class org.klojang.templates.name.SnakeCaseToWordCase
-
Maps a snake case name to a word case name.
- map(String) - Method in class org.klojang.templates.name.WordCaseToCamelCase
-
Maps a word case name to a camel case name.
- map(String) - Method in class org.klojang.templates.name.WordCaseToSnakeLowerCase
-
Maps a word case name to an all-lowercase snake case name.
- map(String) - Method in class org.klojang.templates.name.WordCaseToSnakeUpperCase
-
Maps a word case name to an all-uppercase snake case name.
- map(String) - Method in interface org.klojang.templates.NameMapper
-
Maps the specified name to another name.
- mapName(String) - Static method in class org.klojang.templates.name.CamelCaseToSnakeLowerCase
-
Maps a camel case name to an all-lowercase snake case name.
- mapName(String) - Static method in class org.klojang.templates.name.CamelCaseToSnakeUpperCase
-
Maps a camel case name to an all-uppercase snake case name.
- mapName(String) - Static method in class org.klojang.templates.name.CamelCaseToWordCase
-
Maps a camel case name to a word case name.
- mapName(String) - Static method in class org.klojang.templates.name.SnakeCaseToCamelCase
-
Maps a snake case name to a camel case name.
- mapName(String) - Static method in class org.klojang.templates.name.SnakeCaseToWordCase
-
Maps a snake case name to a word case name.
- mapName(String) - Static method in class org.klojang.templates.name.WordCaseToCamelCase
-
Maps a word case name to a camel case name.
- mapName(String) - Static method in class org.klojang.templates.name.WordCaseToSnakeLowerCase
-
Maps a word case name to an all-lowercase snake case name.
- mapName(String) - Static method in class org.klojang.templates.name.WordCaseToSnakeUpperCase
-
Maps a word case name to an all-uppercase snake case name.
- MISSING_END_TAG - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
An inline template did not close properly.
N
- name() - Method in record class org.klojang.templates.VariableOccurrence
-
Returns the value of the
name
record component. - NameMapper - Interface in org.klojang.templates
-
Generic name mapping interface.
- newRenderSession() - Method in class org.klojang.templates.Template
-
Returns a
RenderSession
that can be used to populate and render thisTemplate
. - newRenderSession(AccessorRegistry) - Method in class org.klojang.templates.Template
-
Returns a
RenderSession
that can be used to populate and render thisTemplate
. - newRenderSession(AccessorRegistry, StringifierRegistry) - Method in class org.klojang.templates.Template
-
Returns a
RenderSession
that you can use to populate and render thisTemplate
. - newRenderSession(StringifierRegistry) - Method in class org.klojang.templates.Template
-
Returns a
RenderSession
that can be used to populate and render thisTemplate
. - NO_CHILD_SESSIONS - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
The child sessions for a nested template were requested, but none were created yet.
- NO_PLACEHOLDER_DEFINED - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
A template variable had the predefined
def:
prefix, but no placeholder value was specified in the template. - NO_SUCH_TEMPLATE - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
A non-existent nested template name was specified.
- NO_SUCH_VARIABLE - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
A non-existent variable name was specified when calling
RenderSession.set()
, or other methods taking a variable name as argument. - NOT_ONE_VAR_TEMPLATE - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
RenderSession.populate1()
was called on a nested template, but it was not a template with exactly one variable. - NOT_TEXT_ONLY - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
RenderSession.enable()
was called on a nested template, but it was not a text-only template. - NOT_TWO_VAR_TEMPLATE - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
RenderSession.populate2()
was called on a nested template, but it was not a template with exactly two variables. - nullEqualsUndefined(boolean) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Determines whether
null
values should be treated just likeAccessor.UNDEFINED
. - Null vs. UNDEFINED - Search tag in org.klojang.templates.Accessor.UNDEFINED
- Section
O
- Optionals - Search tag in org.klojang.templates.RenderSession.populate(String, Object, String, VarGroup, List<String>)
- Section
- org.klojang.templates - module org.klojang.templates
-
Klojang Templates is a templating API written with two goals in mind:
- org.klojang.templates - package org.klojang.templates
-
Main package of this module.
- org.klojang.templates.name - package org.klojang.templates.name
-
Various
NameMapper
implementations for translating names using one naming convention into names using another naming convention.
P
- PARAM - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
param:
prefix. - ParseErrorCode - Enum Class in org.klojang.templates
-
Symbolic constants for syntax errors and other types of errors in a Klojang template.
- ParseException - Exception Class in org.klojang.templates
-
Thrown if the template source could not be parsed into a
Template
. - path() - Method in class org.klojang.templates.Template
-
Returns an
Optional
containing the path to the source code of this template, or an emptyOptional
if the template was created from a string. - PATH - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
path:
prefix. - PathResolver - Interface in org.klojang.templates
-
Path resolvers are used by the template parser to load the source code for a template.
- placeholder() - Method in record class org.klojang.templates.VariableOccurrence
-
Returns the value of the
placeholder
record component. - PLACEHOLDER_NOT_CLOSED - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
A placeholder block was not closed.
- populate(String, Object) - Method in interface org.klojang.templates.RenderSession
-
Populates a template nested inside the template managed by this
RenderSession
. - populate(String, Object, String) - Method in interface org.klojang.templates.RenderSession
-
Populates a template nested inside the template managed by this
RenderSession
. - populate(String, Object, String, VarGroup, List<String>) - Method in interface org.klojang.templates.RenderSession
-
Populates a template nested inside the template being managed by this
RenderSession
. - populateDuo(String, String, VarGroup, List<?>) - Method in interface org.klojang.templates.RenderSession
-
Convenience method for populating a nested template that contains exactly two variables.
- populateDuo(String, List<?>) - Method in interface org.klojang.templates.RenderSession
-
Convenience method for populating a nested template that contains exactly two variables.
- populateSolo(String, String, VarGroup, List<?>) - Method in interface org.klojang.templates.RenderSession
-
Convenience method for populating a nested template that contains exactly one variable.
- populateSolo(String, List<?>) - Method in interface org.klojang.templates.RenderSession
-
Convenience method for populating a nested template that contains exactly one variable.
- position() - Method in record class org.klojang.templates.VariableOccurrence
-
Returns the value of the
position
record component. - printAll() - Static method in class org.klojang.templates.Regex
-
Prints the regular expressions.
- printParts(Template) - Static method in class org.klojang.templates.TemplateUtils
-
Prints out the constituent parts of the specified
Template
. - printParts(Template, PrintStream) - Static method in class org.klojang.templates.TemplateUtils
-
Prints out the constituent parts of the specified
Template
. - property() - Method in enum class org.klojang.templates.Setting
-
Returns the name of the system property for this setting.
R
- Regex - Class in org.klojang.templates
-
Tokens and regular expressions used by the template parser to parse templates.
- REGEX_CMT_INCLUDED_TEMPLATE - Static variable in class org.klojang.templates.Regex
-
Regular expression for an included template that is placed inside an HTML comment.
- REGEX_CMT_VARIABLE - Static variable in class org.klojang.templates.Regex
-
Regular expression for a template variable that is placed inside an HTML comment.
- REGEX_DITCH_BLOCK - Static variable in class org.klojang.templates.Regex
-
Regular expression for ditch blocks.
- REGEX_INCLUDE_PATH - Static variable in class org.klojang.templates.Regex
-
Regular expression for the path specified in an included template.
- REGEX_INCLUDED_TEMPLATE - Static variable in class org.klojang.templates.Regex
-
Regular expression for included templates.
- REGEX_INLINE_TEMPLATE_BEGIN - Static variable in class org.klojang.templates.Regex
-
Regular expression for inline templates begin tags.
- REGEX_INLINE_TEMPLATE_END - Static variable in class org.klojang.templates.Regex
-
Regular expression for inline templates end tags.
- REGEX_NAME - Static variable in class org.klojang.templates.Regex
-
Regular expression for nested template names and path segments within a variable name.
- REGEX_PATH - Static variable in class org.klojang.templates.Regex
-
Regular expression for path strings.
- REGEX_PLACEHOLDER - Static variable in class org.klojang.templates.Regex
-
Regular expression for placeholders.
- REGEX_VAR_GROUP - Static variable in class org.klojang.templates.Regex
-
Regular expression for variable group names.
- REGEX_VARIABLE - Static variable in class org.klojang.templates.Regex
-
Regular expression for template variables.
- register(Class<T>, Accessor<T>) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Sets the
Accessor
to be used for objects of the specified type. - register(BeanReader<T>) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Use the specified
BeanReader
to access objects of the type theBeanReader
can read. - register(BeanReader<T>, NameMapper) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Use the specified
BeanReader
to access objects of the type theBeanReader
can read. - register(BeanReader<T>, Template) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Use the specified
BeanReader
to access objects of the type theBeanReader
can read. - register(BeanReader<T>, Template, NameMapper) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Use the specified
BeanReader
to access objects of the type theBeanReader
can read. - register(Template, Class<T>, Accessor<T>) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Sets the
Accessor
to be used for objects of the specified type, when inserted into the specified template. - register(Template, Stringifier, String...) - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Assigns the specified stringifier to one or more variables in the specified template.
- render() - Method in interface org.klojang.templates.RenderSession
-
Renders the template.
- render(OutputStream) - Method in interface org.klojang.templates.RenderSession
-
Renders the template.
- render(StringBuilder) - Method in interface org.klojang.templates.RenderSession
-
Renders the template.
- RenderErrorCode - Enum Class in org.klojang.templates
-
Symbolic constants for errors that may occur while populating or rendering a template.
- RenderException - Exception Class in org.klojang.templates
-
Thrown from a
RenderSession
under various circumstances. - RenderSession - Interface in org.klojang.templates
-
A
RenderSession
lets you populate a template and then render it. - repeat(String, int) - Method in interface org.klojang.templates.RenderSession
-
Causes the specified nested template to become visible and to be repeated the specified number of times.
- repeat(String, String, int) - Method in interface org.klojang.templates.RenderSession
-
Causes the specified nested template to become visible and to be repeated the specified number of times.
- Repeating Templates - Search tag in org.klojang.templates.RenderSession.populate(String, Object, String, VarGroup, List<String>)
- Section
- REPETITION_MISMATCH - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
The number of elements in the array or
Collection
passed toRenderSession.populate()
differed from the number of repetitions fixed by the first call topopulate()
orrepeat()
. - REPETITIONS_FIXED - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
A call to
RenderSession.repeat()
was made, but the number of repetitions had already been fixed, either by a previous call torepeat()
, or implicitly, via thepopupate()
method. - resolve(String) - Method in interface org.klojang.templates.PathResolver
-
Returns an
InputStream
to the resource denoted by the specified path. - ROOT_TEMPLATE_NAME - Static variable in class org.klojang.templates.Template
-
The name given to the root template: "{root}".
S
- set(String, Object) - Method in interface org.klojang.templates.RenderSession
-
Sets the specified variable to the specified value.
- set(String, Object, VarGroup) - Method in interface org.klojang.templates.RenderSession
-
Sets the specified variable to the specified value.
- setDefaultNameMapper(NameMapper) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Sets the default
NameMapper
used to map template variables to bean properties and/or map keys. - setDefaultStringifier(Stringifier) - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Lets you specify an alternative default stringifier, replacing
Stringifier.DEFAULT
. - setDelayed(String, Supplier<Object>) - Method in interface org.klojang.templates.RenderSession
-
Sets the specified variable to the value produced by the specified
Supplier
. - setDelayed(String, VarGroup, Supplier<Object>) - Method in interface org.klojang.templates.RenderSession
-
Sets the specified variable to the value produced by the specified
Supplier
. - setNameMapper(Template, NameMapper) - Method in class org.klojang.templates.AccessorRegistry.Builder
-
Sets the
NameMapper
to be used for the specified template. - setPath(String, IntFunction<Object>) - Method in interface org.klojang.templates.RenderSession
-
Sets the value of the specified variable.
- setPath(String, VarGroup, boolean, IntFunction<Object>) - Method in interface org.klojang.templates.RenderSession
-
Sets the value of the specified variable.
- Setting - Enum Class in org.klojang.templates
-
Specifies all system properties and/or environment variables that will be picked up by Klojang Templates.
- setType(Class<?>, Template, String...) - Method in class org.klojang.templates.StringifierRegistry.Builder
-
Explicitly sets the data type of the specified variables.
- snakeCaseToCamelCase() - Static method in class org.klojang.templates.name.SnakeCaseToCamelCase
-
Returns an instance of
SnakeCaseToCamelCase
. - SnakeCaseToCamelCase - Class in org.klojang.templates.name
-
Converts snake case identifiers to word case identifiers.
- SnakeCaseToCamelCase() - Constructor for class org.klojang.templates.name.SnakeCaseToCamelCase
- snakeCaseToWordCase() - Static method in class org.klojang.templates.name.SnakeCaseToWordCase
-
Returns an instance of
SnakeCaseToWordCase
. - SnakeCaseToWordCase - Class in org.klojang.templates.name
-
Converts snake case identifiers to word case identifiers.
- SnakeCaseToWordCase() - Constructor for class org.klojang.templates.name.SnakeCaseToWordCase
- standard(boolean) - Static method in class org.klojang.templates.AccessorRegistry
-
Returns an
AccessorRegistry
that should be sufficient for most use cases. - standard(NameMapper) - Static method in class org.klojang.templates.AccessorRegistry
-
Returns an
AccessorRegistry
that should be sufficient for most use cases. - standard(NameMapper, boolean) - Static method in class org.klojang.templates.AccessorRegistry
-
Returns an
AccessorRegistry
that should be sufficient for most use cases. - STANDARD_ACCESSORS - Static variable in class org.klojang.templates.AccessorRegistry
-
The default
AccessorRegistry
. - STANDARD_STRINGIFIERS - Static variable in class org.klojang.templates.StringifierRegistry
-
A minimal
StringifierRegistry
instance. - Stringifier - Interface in org.klojang.templates
-
A stringifier is responsible for stringifying the values that are inserted into a template.
- STRINGIFIER_NOT_NULL_RESISTANT - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
A stringifier's
stringify
method threw aNullPointerException
, but stringifiers must be capable of stringifyingnull
. - STRINGIFIER_RETURNED_NULL - Enum constant in enum class org.klojang.templates.RenderErrorCode
- StringifierRegistry - Class in org.klojang.templates
-
A registry of stringifiers used by the
RenderSession
to stringify the values coming back from the data access layer. - StringifierRegistry.Builder - Class in org.klojang.templates
-
A builder class for
StringifierRegistry
instances. - stringify(Object) - Method in interface org.klojang.templates.Stringifier
-
Stringifies the specified value.
- Syntax - Search tag in module org.klojang.templates
- Section
T
- Template - Class in org.klojang.templates
-
The
Template
class is responsible for loading and parsing templates. - TemplateUtils - Class in org.klojang.templates
-
Utility class extending the functionality of the
Template
class. - TEXT - Static variable in class org.klojang.templates.VarGroup
-
A predefined variable group corresponding to the
text:
prefix. - Thead Safety - Search tag in interface org.klojang.templates.RenderSession
- Section
- TMPL_CACHE_SIZE - Enum constant in enum class org.klojang.templates.Setting
-
System Property:
org.klojang.templates.cacheSize
Environment Variable:KJT_CACHE_SIZE
Default Value:-1
. - toString() - Method in class org.klojang.templates.Template
-
More or less re-assembles to source code from the constituent parts of the
Template
. - toString() - Method in class org.klojang.templates.VarGroup
-
Returns the name of this
VarGroup
, which is also the prefix to be used inside a template. - toString() - Method in record class org.klojang.templates.VariableOccurrence
-
Returns a string representation of this record class.
U
- UNDEFINED - Static variable in interface org.klojang.templates.Accessor
-
The value that should be returned by accessors if a template variable cannot be mapped to a value in the source data object.
- UNEXPECTED_ERROR - Enum constant in enum class org.klojang.templates.RenderErrorCode
-
An unexpected error occurred while rendering the template.
- unset(String...) - Method in interface org.klojang.templates.RenderSession
-
Unsets the specified variables.
- Using the API - Search tag in module org.klojang.templates
- Section
V
- valueOf(String) - Static method in enum class org.klojang.templates.ParseErrorCode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.klojang.templates.RenderErrorCode
-
Returns the enum constant of this class with the specified name.
- valueOf(String) - Static method in enum class org.klojang.templates.Setting
-
Returns the enum constant of this class with the specified name.
- values() - Static method in enum class org.klojang.templates.ParseErrorCode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.klojang.templates.RenderErrorCode
-
Returns an array containing the constants of this enum class, in the order they are declared.
- values() - Static method in enum class org.klojang.templates.Setting
-
Returns an array containing the constants of this enum class, in the order they are declared.
- VAR_WITH_TMPL_NAME - Enum constant in enum class org.klojang.templates.ParseErrorCode
-
The template contained a variable with the same name as a nested template.
- varGroup() - Method in record class org.klojang.templates.VariableOccurrence
-
Returns the value of the
varGroup
record component. - VarGroup - Class in org.klojang.templates
-
Variable groups allow you to group template variables across one or more templates.
- VariableOccurrence - Record Class in org.klojang.templates
-
Represents a concrete occurrence of a variable within a template.
- VariableOccurrence(String, Optional<VarGroup>, Optional<String>, int) - Constructor for record class org.klojang.templates.VariableOccurrence
-
Creates an instance of a
VariableOccurrence
record class.
W
- wordCaseToCameCase() - Static method in class org.klojang.templates.name.WordCaseToCamelCase
-
Returns an instance of
WordCaseToCameCase
. - WordCaseToCamelCase - Class in org.klojang.templates.name
-
Converts word case identifiers to came cal identifiers.
- WordCaseToCamelCase() - Constructor for class org.klojang.templates.name.WordCaseToCamelCase
- wordCaseToSnakeLowerCase() - Static method in class org.klojang.templates.name.WordCaseToSnakeLowerCase
-
Returns an instance of
WordCaseToSnakeLowerCase
. - WordCaseToSnakeLowerCase - Class in org.klojang.templates.name
-
Converts word case identifiers to snake case identifiers.
- WordCaseToSnakeLowerCase() - Constructor for class org.klojang.templates.name.WordCaseToSnakeLowerCase
- wordCaseToSnakeUpperCase() - Static method in class org.klojang.templates.name.WordCaseToSnakeUpperCase
-
Returns an instance of
WordCaseToSnakeUpperCase
. - WordCaseToSnakeUpperCase - Class in org.klojang.templates.name
-
Converts camel case identifiers to snake case identifiers.
- WordCaseToSnakeUpperCase() - Constructor for class org.klojang.templates.name.WordCaseToSnakeUpperCase
All Classes and Interfaces|All Packages|Constant Field Values|Serialized Form