java.lang.Object
io.helidon.inject.tools.TemplateHelper
Helper tools for dealing with Injection-related Handlebar templates.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionapplySubstitutions
(CharSequence target, Map<String, Object> props, boolean logErr) Apply substitutions.static TemplateHelper
create()
Creates a template helper utility using the global bootstrap configuration.generatedStickerFor
(TypeName generatorClassTypeName, TypeName triggerClassType, TypeName generatedType) Produces the generated sticker annotation attribute contents.loadTemplate
(String templateName, String name) Same assafeLoadTemplate(String, String)
but will return null if the template name is not found.requiredArguments
(String target) Determine the arguments needed for template evaluation.
-
Field Details
-
TAG_TEMPLATE_NAME
The tag that us used to represent the template name to use.- See Also:
-
DEFAULT_TEMPLATE_NAME
The default template name to use.- See Also:
-
-
Method Details
-
create
Creates a template helper utility using the global bootstrap configuration.- Returns:
- the template helper initialized with the bootstrap configuration
-
generatedStickerFor
public String generatedStickerFor(TypeName generatorClassTypeName, TypeName triggerClassType, TypeName generatedType) Produces the generated sticker annotation attribute contents.- Parameters:
generatorClassTypeName
- the generator class type nametriggerClassType
- class that caused the type to be generatedgeneratedType
- generated type- Returns:
- the generated sticker
-
applySubstitutions
Apply substitutions.- Parameters:
target
- the target string to find substitutions forprops
- the replacementslogErr
- flag indicating whether logger should be written for errors and warnings- Returns:
- the new string, fully resolved with substitutions
-
requiredArguments
Determine the arguments needed for template evaluation.- Parameters:
target
- the target template- Returns:
- the set of attributes that are required for substitution
-
loadTemplate
Same assafeLoadTemplate(String, String)
but will return null if the template name is not found.- Parameters:
templateName
- the template profile/directoryname
- the template name to use- Returns:
- the template, or null if not found
-