|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.ujac.util.template.TemplateToken org.ujac.util.template.TemplateTokenContainer org.ujac.util.template.ProcedureToken
public class ProcedureToken
Name: ProcedureToken
Description: Represents a _procedure_ statement.
Field Summary | |
---|---|
static TokenAncestor[] |
ancestorRules
The ancestor rules. |
Fields inherited from class org.ujac.util.template.TemplateTokenContainer |
---|
procedureRegistry |
Fields inherited from class org.ujac.util.template.TemplateToken |
---|
interpreter, nextLegalAncestor, parent, position, source |
Constructor Summary | |
---|---|
ProcedureToken()
Constructs a ProcedureToken instance with no specific attributes. |
Method Summary | |
---|---|
boolean |
checkContainer(TemplateTokenContainer container)
Checks whether this token is valid for the given container. |
Object |
clone()
|
protected TemplateToken |
cloneToken(BaseTemplateInterpreter interpreter,
TemplateTokenContainer parent)
Clones the token for caching reasons. |
protected void |
execute(List arguments,
Writer writer,
TemplateContext ctx)
Calls the procedure. |
void |
execute(Writer writer,
TemplateContext ctx)
Excecutes the statement token. |
TokenAncestor[] |
getAncestorRules()
Gets the ancestor rules for this template. |
List |
getArguments()
Getter method for the the property arguments. |
protected String |
getArgumentsAsString()
Gets the argument list as string. |
String |
getName()
Getter method for the the property name. |
String |
getTokenName()
Gets the token name. |
void |
initialize(BaseTemplateInterpreter interpreter,
char[] source,
int position,
int length)
Initializes the token. |
void |
setArgument(Operand argument,
int idx)
Sets an argument. |
String |
toString()
|
Methods inherited from class org.ujac.util.template.TemplateTokenContainer |
---|
addToken, clearTokens, cloneChildTokens, close, getBodyEnd, getBodyStart, getProcedureRegistry, getToken, getTokenCount, isBodyToken, isClosed, setBodyStart, setProcedureRegistry |
Methods inherited from class org.ujac.util.template.TemplateToken |
---|
getEndPosition, getIndention, getLength, getLevel, getParent, getPosition, getSource, isLegalAncestor, isLegalAncestor, parseArguments, parseArguments, setLength, setLevel, setParent |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final TokenAncestor[] ancestorRules
Constructor Detail |
---|
public ProcedureToken()
Method Detail |
---|
public String getTokenName()
getTokenName
in class TemplateToken
public void initialize(BaseTemplateInterpreter interpreter, char[] source, int position, int length) throws TemplateException
initialize
in class TemplateToken
interpreter
- The template interpreter.source
- The source code.position
- The start position.length
- The length of the interresting area.
TemplateException
- In case the initialization failed.public String getName()
public TokenAncestor[] getAncestorRules()
getAncestorRules
in class TemplateToken
public boolean checkContainer(TemplateTokenContainer container)
checkContainer
in class TemplateToken
container
- The container that wants to add the token.
public void setArgument(Operand argument, int idx)
setArgument
in class TemplateToken
argument
- The argument to set.idx
- The argument index.public List getArguments()
public void execute(Writer writer, TemplateContext ctx) throws ExpressionException, IOException
execute
in class TemplateToken
writer
- The writer to write to.ctx
- The template context.
ExpressionException
- If the token could not be successfuly executed.
IOException
- In case an output failure occurred.protected void execute(List arguments, Writer writer, TemplateContext ctx) throws IOException, TemplateException
arguments
- The arguments to use for the procedure call.writer
- The writer, to which to write the result.ctx
- The template context.
IOException
- In case an I/O problem occurred.
TemplateException
- If something went wrong.public String toString()
toString
in class TemplateTokenContainer
Object.toString()
protected String getArgumentsAsString()
getArgumentsAsString
in class TemplateToken
protected TemplateToken cloneToken(BaseTemplateInterpreter interpreter, TemplateTokenContainer parent)
cloneToken
in class TemplateToken
interpreter
- The interpreter to use.parent
- The actual parent in the cloned object tree.
public Object clone()
clone
in class Object
Object.clone()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |