Package com.github.mustachejava.codes
Class ValueCode
- java.lang.Object
-
- com.github.mustachejava.codes.DefaultCode
-
- com.github.mustachejava.codes.ValueCode
-
- All Implemented Interfaces:
Code,java.lang.Cloneable
- Direct Known Subclasses:
SpecMustacheVisitor.SpecValueCode
public class ValueCode extends DefaultCode
Output a value
-
-
Field Summary
Fields Modifier and Type Field Description private java.util.regex.PatterncompiledAppendedprotected booleanencodedprotected java.util.concurrent.ExecutorServiceles-
Fields inherited from class com.github.mustachejava.codes.DefaultCode
appended, binding, df, mustache, name, oh, returnThis, tc, type
-
-
Constructor Summary
Constructors Constructor Description ValueCode(TemplateContext tc, DefaultMustacheFactory df, java.lang.String variable, boolean encoded)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voidexecute(java.io.Writer writer, java.lang.String value)private voidexecute(java.io.Writer writer, java.util.concurrent.Callable callable)java.io.Writerexecute(java.io.Writer writer, java.util.List<java.lang.Object> scopes)The default behavior is to run the codes and append the captured text.protected java.io.WriterhandleCallable(java.io.Writer writer, java.util.concurrent.Callable callable, java.util.List<java.lang.Object> scopes)protected voidhandleFunction(java.io.Writer writer, java.util.function.Function function, java.util.List<java.lang.Object> scopes)voididentity(java.io.Writer writer)Nodeinvert(Node node, java.lang.String text, java.util.concurrent.atomic.AtomicInteger position)-
Methods inherited from class com.github.mustachejava.codes.DefaultCode
addScope, append, appendText, clone, clone, filterText, get, getCodes, getName, init, matchAppended, run, runIdentity, setCodes, tag
-
-
-
-
Constructor Detail
-
ValueCode
public ValueCode(TemplateContext tc, DefaultMustacheFactory df, java.lang.String variable, boolean encoded)
-
-
Method Detail
-
identity
public void identity(java.io.Writer writer)
- Specified by:
identityin interfaceCode- Overrides:
identityin classDefaultCode
-
execute
public java.io.Writer execute(java.io.Writer writer, java.util.List<java.lang.Object> scopes)Description copied from class:DefaultCodeThe default behavior is to run the codes and append the captured text.- Specified by:
executein interfaceCode- Overrides:
executein classDefaultCode- Parameters:
writer- The writer to write the output toscopes- The scopes to evaluate the embedded names against.
-
handleCallable
protected java.io.Writer handleCallable(java.io.Writer writer, java.util.concurrent.Callable callable, java.util.List<java.lang.Object> scopes) throws java.lang.Exception- Throws:
java.lang.Exception
-
execute
private void execute(java.io.Writer writer, java.util.concurrent.Callable callable) throws java.lang.Exception- Throws:
java.lang.Exception
-
handleFunction
protected void handleFunction(java.io.Writer writer, java.util.function.Function function, java.util.List<java.lang.Object> scopes) throws java.io.IOException- Throws:
java.io.IOException
-
execute
protected void execute(java.io.Writer writer, java.lang.String value) throws java.io.IOException- Throws:
java.io.IOException
-
-