public class DefaultCode extends java.lang.Object implements Code, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
protected java.lang.String |
appended |
protected static boolean |
debug |
protected static java.util.logging.Logger |
logger |
protected Mustache |
mustache |
protected java.lang.String |
name |
protected ObjectHandler |
oh |
protected boolean |
returnThis |
protected TemplateContext |
tc |
protected java.lang.String |
type |
Constructor and Description |
---|
DefaultCode() |
DefaultCode(TemplateContext tc,
ObjectHandler oh,
Mustache mustache,
java.lang.String name,
java.lang.String type) |
Modifier and Type | Method and Description |
---|---|
protected java.lang.Object[] |
addScope(java.lang.Object next,
java.lang.Object[] scopes)
Allocating new scopes is currently the only place where we are activtely allocating
memory within the templating system.
|
void |
append(java.lang.String text) |
protected java.io.Writer |
appendText(java.io.Writer writer) |
java.lang.Object |
clone() |
java.io.Writer |
execute(java.io.Writer writer,
java.lang.Object scope) |
java.io.Writer |
execute(java.io.Writer writer,
java.lang.Object[] scopes)
The default behavior is to run the codes and append the captured text.
|
java.lang.Object |
get(java.lang.Object[] scopes)
Retrieve the first value in the stacks of scopes that matches
the give name.
|
Code[] |
getCodes() |
protected Wrapper |
getWrapper(java.lang.String name,
java.lang.Object[] scopes) |
void |
identity(java.io.Writer writer) |
void |
init() |
protected java.io.Writer |
runCodes(java.io.Writer writer,
java.lang.Object[] scopes) |
protected void |
runIdentity(java.io.Writer writer) |
void |
setCodes(Code[] newcodes) |
protected java.lang.String appended
protected final ObjectHandler oh
protected final java.lang.String name
protected final TemplateContext tc
protected final Mustache mustache
protected final java.lang.String type
protected final boolean returnThis
protected static boolean debug
protected static java.util.logging.Logger logger
public DefaultCode()
public DefaultCode(TemplateContext tc, ObjectHandler oh, Mustache mustache, java.lang.String name, java.lang.String type)
public java.lang.Object clone()
public java.lang.Object get(java.lang.Object[] scopes)
scopes
- An array of scopes to interrogate from right to left.protected Wrapper getWrapper(java.lang.String name, java.lang.Object[] scopes)
public java.io.Writer execute(java.io.Writer writer, java.lang.Object scope)
public java.io.Writer execute(java.io.Writer writer, java.lang.Object[] scopes)
protected void runIdentity(java.io.Writer writer)
protected java.io.Writer appendText(java.io.Writer writer)
protected java.io.Writer runCodes(java.io.Writer writer, java.lang.Object[] scopes)
protected java.lang.Object[] addScope(java.lang.Object next, java.lang.Object[] scopes)
Copyright © 2012. All Rights Reserved.