| Method from org.apache.velocity.runtime.parser.node.SimpleNode Detail: |
public Object childrenAccept(ParserVisitor visitor,
Object data) {
if (children != null)
{
for (int i = 0; i < children.length; ++i)
{
children[i].jjtAccept(visitor, data);
}
}
return data;
}
|
public void dump(String prefix) {
System.out.println(toString(prefix));
if (children != null)
{
for (int i = 0; i < children.length; ++i)
{
SimpleNode n = (SimpleNode) children[i];
if (n != null)
{
n.dump(prefix + " ");
}
}
}
}
Override this method if you want to customize how the node dumps
out its children. |
public boolean evaluate(InternalContextAdapter context) throws MethodInvocationException {
return false;
}
|
public Object execute(Object o,
InternalContextAdapter context) throws MethodInvocationException {
return null;
}
|
public int getColumn() {
return first.beginColumn;
}
|
public Token getFirstToken() {
return first;
}
|
public int getInfo() {
return info;
}
|
public Token getLastToken() {
return last;
}
|
public int getLine() {
return first.beginLine;
}
|
public int getType() {
return id;
}
|
public Object init(InternalContextAdapter context,
Object data) throws TemplateInitException {
/*
* hold onto the RuntimeServices
*/
rsvc = (RuntimeServices) data;
log = rsvc.getLog();
int i, k = jjtGetNumChildren();
for (i = 0; i < k; i++)
{
jjtGetChild(i).init( context, data);
}
return data;
}
|
public boolean isInvalid() {
return invalid;
}
|
public Object jjtAccept(ParserVisitor visitor,
Object data) {
return visitor.visit(this, data);
}
|
public void jjtAddChild(Node n,
int i) {
if (children == null)
{
children = new Node[i + 1];
}
else if (i >= children.length)
{
Node c[] = new Node[i + 1];
System.arraycopy(children, 0, c, 0, children.length);
children = c;
}
children[i] = n;
}
|
public void jjtClose() {
last = parser.getToken(0); // added
}
|
public Node jjtGetChild(int i) {
return children[i];
}
|
public int jjtGetNumChildren() {
return (children == null) ? 0 : children.length;
}
|
public Node jjtGetParent() {
return parent;
}
|
public void jjtOpen() {
first = parser.getToken(1); // added
}
|
public void jjtSetParent(Node n) {
parent = n;
}
|
public String literal() {
Token t = first;
StringBuffer sb = new StringBuffer(t.image);
while (t != last)
{
t = t.next;
sb.append(t.image);
}
return sb.toString();
}
|
public boolean render(InternalContextAdapter context,
Writer writer) throws MethodInvocationException, IOException, ResourceNotFoundException, ParseErrorException {
int i, k = jjtGetNumChildren();
for (i = 0; i < k; i++)
jjtGetChild(i).render(context, writer);
return true;
}
|
public void setFirstToken(Token t) {
this.first = t;
}
|
public void setInfo(int info) {
this.info = info;
}
|
public void setInvalid() {
invalid = true;
}
|
public String toString() {
StringBuffer tokens = new StringBuffer();
for (Token t = getFirstToken(); t != null; )
{
tokens.append("[").append(t.image).append("]");
if (t.next != null)
{
if (t.equals(getLastToken()))
{
break;
}
else
{
tokens.append(", ");
}
}
t = t.next;
}
return new ToStringBuilder(this)
.append("id", getType())
.append("info", getInfo())
.append("invalid", isInvalid())
.append("children", jjtGetNumChildren())
.append("tokens", tokens)
.toString();
}
|
public String toString(String prefix) {
return prefix + toString();
}
|
public Object value(InternalContextAdapter context) throws MethodInvocationException {
return null;
}
|