org.ujac.util.template
Class TemplateRoot
java.lang.Object
org.ujac.util.template.TemplateToken
org.ujac.util.template.TemplateTokenContainer
org.ujac.util.template.TemplateRoot
- All Implemented Interfaces:
- Serializable, Cloneable
public class TemplateRoot
- extends TemplateTokenContainer
Name: TemplateRoot
Description: A class for root elements of the template parse tree.
- Author:
- lauerc
- See Also:
- Serialized Form
|
Constructor Summary |
TemplateRoot(char[] source,
int position,
int length)
Constructs a TemplateRoot instance with specific attributes. |
| Methods inherited from class org.ujac.util.template.TemplateTokenContainer |
addToken, clearTokens, cloneChildTokens, close, getBodyEnd, getBodyStart, getProcedureRegistry, getToken, getTokenCount, isBodyToken, isClosed, setBodyStart, setProcedureRegistry, toString |
| Methods inherited from class org.ujac.util.template.TemplateToken |
checkContainer, getAncestorRules, getArgumentsAsString, getEndPosition, getIndention, getLength, getLevel, getParent, getPosition, getSource, getTokenName, initialize, isLegalAncestor, isLegalAncestor, parseArguments, parseArguments, setLength, setLevel, setParent |
TemplateRoot
public TemplateRoot(char[] source,
int position,
int length)
throws TemplateException
- Constructs a TemplateRoot instance with specific attributes.
- Parameters:
source - The source code.position - The statement's position in the source code.length - The length of the token.
- Throws:
TemplateException - In case the initialization failed.
setArgument
public void setArgument(Operand argument,
int idx)
- Sets an argument.
- Specified by:
setArgument in class TemplateToken
- Parameters:
argument - The argument to set.idx - The argument index.
execute
public void execute(Writer writer,
TemplateContext ctx)
throws TemplateException,
IOException
- Excecutes the statement token.
- Specified by:
execute in class TemplateToken
- Parameters:
writer - The writer to write to.ctx - The template context.
- Throws:
TemplateException - If the token could not be successfuly executed.
IOException - In case an output failure occurred.
cloneToken
protected TemplateToken cloneToken(BaseTemplateInterpreter interpreter,
TemplateTokenContainer parent)
- Clones the token for caching reasons.
- Specified by:
cloneToken in class TemplateToken
- Parameters:
interpreter - The interpreter to use.parent - The actual parent in the cloned object tree.
- Returns:
- The clone.
clone
public Object clone()
- Overrides:
clone in class Object
- See Also:
Object.clone()
Copyright © 2003-2004 UJAC.org. All Rights Reserved.