Class CtxExtraDateSerializerRenderer
java.lang.Object
dk.mada.jaxrs.generator.mpclient.dto.tmpl.CtxExtraDateSerializerRenderer
Generated Renderer.
-
Constructor Summary
ConstructorsConstructorDescriptionRenderer constructor for reflection (use of() instead).Renderer constructor for manual wiring. -
Method Summary
Modifier and TypeMethodDescriptionexecute
(CtxExtraDateSerializer model) Convenience method that directly renders the model as a String.void
execute
(CtxExtraDateSerializer model, Appendable a) Renders the passed in model.protected void
execute
(CtxExtraDateSerializer model, Appendable a, Function<Object, String> formatter, Function<String, String> escaper) Renders the passed in model.Class
<?> Model class.of()
Convience static factory that will reuse the same singleton instance.static void
render
(CtxExtraDateSerializer data, Appendable unescapedWriter, Function<Object, String> formatter, Function<String, String> escaper) Renders the passed in model.boolean
supportsType
(Class<?> type) If this template support the model classTemplate charset name.Current escaper.Current formatter.Logical template name.Template path.Template contents or blank if path.
-
Constructor Details
-
CtxExtraDateSerializerRenderer
public CtxExtraDateSerializerRenderer(Function<Object, String> formatter, Function<String, String> escaper) Renderer constructor for manual wiring.- Parameters:
formatter
- formatter if null the static formatter will be used.escaper
- escaper if null the static escaper will be used
-
CtxExtraDateSerializerRenderer
public CtxExtraDateSerializerRenderer()Renderer constructor for reflection (use of() instead). For programmatic consider usingof()
for a shared singleton.
-
-
Method Details
-
execute
Renders the passed in model.- Parameters:
model
- a model assumed never to benull
.a
- the appendable to write to.- Throws:
IOException
- if there is an error writing to the appendable
-
execute
Convenience method that directly renders the model as a String.- Parameters:
model
- never null.- Returns:
- the rendered model.
-
execute
protected void execute(CtxExtraDateSerializer model, Appendable a, Function<Object, String> formatter, Function<String, throws IOExceptionString> escaper) Renders the passed in model.- Parameters:
model
- a model assumed never to benull
.a
- appendable to write to.formatter
- formats variables before they are passed to the escaperescaper
- used to write escaped variables- Throws:
IOException
- if an error occurs while writing to the appendable
-
supportsType
If this template support the model class- Parameters:
type
- model class.- Returns:
- true if the renderer supports the class
-
templatePath
Template path.- Returns:
- template path of resource or pseudo inline path
-
templateName
Logical template name.- Returns:
- template name
-
templateCharset
Template charset name.- Returns:
- charset name of template
-
templateString
Template contents or blank if path.- Returns:
- inline template
-
templateEscaper
Current escaper.- Returns:
- escaper
-
templateFormatter
Current formatter.- Returns:
- formatter
-
modelClass
Model class.- Returns:
- class used as model (annotated with JStache).
-
of
Convience static factory that will reuse the same singleton instance.- Returns:
- renderer same as calling no-arg constructor but is cached with singleton instance
-
render
public static void render(CtxExtraDateSerializer data, Appendable unescapedWriter, Function<Object, String> formatter, Function<String, throws IOExceptionString> escaper) Renders the passed in model.- Parameters:
data
- modelunescapedWriter
- appendable to write to.formatter
- formats variables before they are passed to the escaper.escaper
- used to write escaped variables.- Throws:
IOException
- if an error occurs while writing to the appendable
-