ariba.util.expr
Class SimpleNode

java.lang.Object
  extended by ariba.util.expr.SimpleNode
All Implemented Interfaces:
Node, java.io.Serializable
Direct Known Subclasses:
ExpressionNode

public abstract class SimpleNode
extends java.lang.Object
implements Node, java.io.Serializable

Author:
Luke Blanshard (blanshlu@netscape.net), Drew Davidson (drew@ognl.org)
See Also:
Serialized Form

Field Summary
static java.lang.String TRACE_NULL
          Text output when value is null
static java.lang.String TRACE_UNKNOWN
          Text output when field/value can not be determined
 
Constructor Summary
SimpleNode(ariba.util.expr.ExprParser p, int i)
           
SimpleNode(int i)
           
 
Method Summary
 void accept(ASTNodeVisitor visitor)
           
 void dump(java.io.PrintWriter writer, java.lang.String prefix)
           
 int getIndexInParent()
           
 Node getNextSibling()
           
 TypeInfo getTypeInfo()
           
 java.lang.Object getValue(ExprContext context, java.lang.Object source)
          Extracts the value from the given source object that is appropriate for this node within the given context.
 boolean isConstant(ExprContext context)
           
static boolean isExpressionTracingEnabled()
          Determine if expression tracing is enabled.
 boolean isNodeConstant(ExprContext context)
          Returns true iff this node is constant without respect to the children.
 boolean isNodeSimpleProperty(ExprContext context)
           
 boolean isSimpleNavigationChain(ExprContext context)
           
 boolean isSimpleProperty(ExprContext context)
           
 void jjtAddChild(Node n, int i)
          This method tells the node to add its argument to the node's list of children.
 void jjtClose()
          This method is called after all the child nodes have been added.
 Node jjtGetChild(int i)
          This method returns a child node.
 int jjtGetNumChildren()
          Return the number of children the node has.
 Node jjtGetParent()
           
 void jjtOpen()
          This method is called after the node has been made the current node.
 void jjtSetParent(Node n)
          This pair of methods are used to inform the node of its parent.
 void setTypeInfo(TypeInfo typeInfo)
           
 void setValue(ExprContext context, java.lang.Object target, java.lang.Object value)
          Sets the given value in the given target as appropriate for this node within the given context.
 java.lang.String toString()
           
 java.lang.String toString(java.lang.String prefix)
           
static void traceExpression(java.lang.CharSequence msg)
          Log an expression trace.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

TRACE_UNKNOWN

public static final java.lang.String TRACE_UNKNOWN
Text output when field/value can not be determined

See Also:
Constant Field Values

TRACE_NULL

public static final java.lang.String TRACE_NULL
Text output when value is null

See Also:
Constant Field Values
Constructor Detail

SimpleNode

public SimpleNode(int i)

SimpleNode

public SimpleNode(ariba.util.expr.ExprParser p,
                  int i)
Method Detail

jjtOpen

public void jjtOpen()
Description copied from interface: Node
This method is called after the node has been made the current node. It indicates that child nodes can now be added to it.

Specified by:
jjtOpen in interface Node

jjtClose

public void jjtClose()
Description copied from interface: Node
This method is called after all the child nodes have been added.

Specified by:
jjtClose in interface Node

jjtSetParent

public void jjtSetParent(Node n)
Description copied from interface: Node
This pair of methods are used to inform the node of its parent.

Specified by:
jjtSetParent in interface Node

jjtGetParent

public Node jjtGetParent()
Specified by:
jjtGetParent in interface Node

jjtAddChild

public void jjtAddChild(Node n,
                        int i)
Description copied from interface: Node
This method tells the node to add its argument to the node's list of children.

Specified by:
jjtAddChild in interface Node

jjtGetChild

public Node jjtGetChild(int i)
Description copied from interface: Node
This method returns a child node. The children are numbered from zero, left to right.

Specified by:
jjtGetChild in interface Node

jjtGetNumChildren

public int jjtGetNumChildren()
Description copied from interface: Node
Return the number of children the node has.

Specified by:
jjtGetNumChildren in interface Node

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

toString

public java.lang.String toString(java.lang.String prefix)

dump

public void dump(java.io.PrintWriter writer,
                 java.lang.String prefix)

getIndexInParent

public int getIndexInParent()

getNextSibling

public Node getNextSibling()

getValue

public final java.lang.Object getValue(ExprContext context,
                                       java.lang.Object source)
                                throws ExprException
Description copied from interface: Node
Extracts the value from the given source object that is appropriate for this node within the given context.

Specified by:
getValue in interface Node
Throws:
ExprException

setValue

public final void setValue(ExprContext context,
                           java.lang.Object target,
                           java.lang.Object value)
                    throws ExprException
Description copied from interface: Node
Sets the given value in the given target as appropriate for this node within the given context.

Specified by:
setValue in interface Node
Throws:
ExprException

isNodeConstant

public boolean isNodeConstant(ExprContext context)
                       throws ExprException
Returns true iff this node is constant without respect to the children.

Throws:
ExprException

isConstant

public boolean isConstant(ExprContext context)
                   throws ExprException
Throws:
ExprException

isNodeSimpleProperty

public boolean isNodeSimpleProperty(ExprContext context)
                             throws ExprException
Throws:
ExprException

isSimpleProperty

public boolean isSimpleProperty(ExprContext context)
                         throws ExprException
Throws:
ExprException

isSimpleNavigationChain

public boolean isSimpleNavigationChain(ExprContext context)
                                throws ExprException
Throws:
ExprException

accept

public void accept(ASTNodeVisitor visitor)
Specified by:
accept in interface Node

getTypeInfo

public TypeInfo getTypeInfo()
Specified by:
getTypeInfo in interface Node

setTypeInfo

public void setTypeInfo(TypeInfo typeInfo)
Specified by:
setTypeInfo in interface Node

isExpressionTracingEnabled

public static final boolean isExpressionTracingEnabled()
Determine if expression tracing is enabled.

Returns:
true iff expression tracing is enabled

traceExpression

public static final void traceExpression(java.lang.CharSequence msg)
Log an expression trace. Nothing logged if null text or tracing level insufficient.

Parameters:
msg - text to output; may be null or empty


AribaWeb User Interface Development Framework
Copyright © 2000-2014 Ariba, Inc. All Rights Reserved.