java.lang.Object
io.jstach.jstachio.spi.AbstractJStachio
- All Implemented Interfaces:
JStachio
,Renderer<Object>
,JStachioExtensions.Provider
- Direct Known Subclasses:
SpringJStachio
public abstract class AbstractJStachio
extends Object
implements JStachio, JStachioExtensions.Provider
An abstract jstachio that just needs a
JStachioExtensions
container.
To extend just override JStachioExtensions.Provider.extensions()
.
- Author:
- agentgt
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionFinds a template by using the models class if possible and then applies filtering and then finally render the model to a String.void
execute
(Object model, Appendable appendable) Finds a template by using the models class if possible and then applies filtering and then finally render the model by writing to the appendable.execute
(Object model, StringBuilder sb) Finds a template by using the models class if possible and then applies filtering and then finally render the model by writing to theStringBuilder
.boolean
supportsType
(Class<?> modelType) Determines if this jstachio can render the model type (the class annotated by JStache).Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.jstach.jstachio.spi.JStachioExtensions.Provider
extensions
-
Constructor Details
-
AbstractJStachio
public AbstractJStachio()Do nothing constructor
-
-
Method Details
-
execute
Description copied from interface:JStachio
Finds a template by using the models class if possible and then applies filtering and then finally render the model by writing to the appendable.Renders the passed in model.
-
execute
Description copied from interface:JStachio
Finds a template by using the models class if possible and then applies filtering and then finally render the model by writing to theStringBuilder
.A convenience method that does not throw
IOException
when using StringBuilder. -
execute
Description copied from interface:JStachio
Finds a template by using the models class if possible and then applies filtering and then finally render the model to a String.Convenience method that directly renders the model as a String.
-
supportsType
Description copied from interface:JStachio
Determines if this jstachio can render the model type (the class annotated by JStache).- Specified by:
supportsType
in interfaceJStachio
- Parameters:
modelType
- the models class (the one annotated withJStache
and not the Templates class)- Returns:
- true if this jstachio can render instances of modelType
-