|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.commons.ognl.SimpleNode
public abstract class SimpleNode
Field Summary | |
---|---|
protected Node[] |
children
|
protected int |
id
|
protected Node |
parent
|
protected OgnlParser |
parser
|
Constructor Summary | |
---|---|
SimpleNode(int i)
|
|
SimpleNode(OgnlParser p,
int i)
|
Method Summary | |
---|---|
void |
dump(PrintWriter writer,
String prefix)
|
protected Object |
evaluateGetValueBody(OgnlContext context,
Object source)
|
protected void |
evaluateSetValueBody(OgnlContext context,
Object target,
Object value)
|
protected void |
flattenTree()
This method may be called from subclasses' jjtClose methods. |
ExpressionAccessor |
getAccessor()
Gets the compiled bytecode enhanced expression accessor for getting/setting values. |
int |
getIndexInParent()
|
Node |
getNextSibling()
|
Object |
getValue(OgnlContext context,
Object source)
Extracts the value from the given source object that is appropriate for this node within the given context. |
protected abstract Object |
getValueBody(OgnlContext context,
Object source)
Subclasses implement this method to do the actual work of extracting the appropriate value from the source object. |
boolean |
isConstant(OgnlContext context)
|
boolean |
isEvalChain(OgnlContext context)
|
boolean |
isNodeConstant(OgnlContext context)
Returns true iff this node is constant without respect to the children. |
boolean |
isNodeSimpleProperty(OgnlContext context)
|
boolean |
isSimpleNavigationChain(OgnlContext context)
|
boolean |
isSimpleProperty(OgnlContext 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. |
protected boolean |
lastChild(OgnlContext context)
|
void |
setAccessor(ExpressionAccessor accessor)
Sets a new compiled accessor for this node expression. |
void |
setValue(OgnlContext context,
Object target,
Object value)
Sets the given value in the given target as appropriate for this node within the given context. |
protected void |
setValueBody(OgnlContext context,
Object target,
Object value)
Subclasses implement this method to do the actual work of setting the appropriate value in the target object. |
String |
toGetSourceString(OgnlContext context,
Object target)
Expected to return a java source representation of itself such that it could be turned into a literal java expression to be compiled and executed for ExpressionAccessor.get(OgnlContext, Object) calls. |
String |
toSetSourceString(OgnlContext context,
Object target)
Expected to return a java source representation of itself such that it could be turned into a literal java expression to be compiled and executed for ExpressionAccessor.get(OgnlContext, Object) calls. |
String |
toString()
|
String |
toString(String prefix)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.commons.ognl.Node |
---|
accept |
Field Detail |
---|
protected Node parent
protected Node[] children
protected int id
protected OgnlParser parser
Constructor Detail |
---|
public SimpleNode(int i)
public SimpleNode(OgnlParser p, int i)
Method Detail |
---|
public void jjtOpen()
Node
jjtOpen
in interface Node
public void jjtClose()
Node
jjtClose
in interface Node
public void jjtSetParent(Node n)
Node
jjtSetParent
in interface Node
public Node jjtGetParent()
jjtGetParent
in interface Node
public void jjtAddChild(Node n, int i)
Node
jjtAddChild
in interface Node
public Node jjtGetChild(int i)
Node
jjtGetChild
in interface Node
public int jjtGetNumChildren()
Node
jjtGetNumChildren
in interface Node
public String toString()
toString
in class Object
public String toString(String prefix)
public String toGetSourceString(OgnlContext context, Object target)
JavaSource
ExpressionAccessor.get(OgnlContext, Object)
calls.
toGetSourceString
in interface JavaSource
public String toSetSourceString(OgnlContext context, Object target)
JavaSource
ExpressionAccessor.get(OgnlContext, Object)
calls.
toSetSourceString
in interface JavaSource
public void dump(PrintWriter writer, String prefix)
public int getIndexInParent()
public Node getNextSibling()
protected Object evaluateGetValueBody(OgnlContext context, Object source) throws OgnlException
OgnlException
protected void evaluateSetValueBody(OgnlContext context, Object target, Object value) throws OgnlException
OgnlException
public final Object getValue(OgnlContext context, Object source) throws OgnlException
Node
getValue
in interface Node
OgnlException
protected abstract Object getValueBody(OgnlContext context, Object source) throws OgnlException
OgnlException
public final void setValue(OgnlContext context, Object target, Object value) throws OgnlException
Node
setValue
in interface Node
OgnlException
protected void setValueBody(OgnlContext context, Object target, Object value) throws OgnlException
InappropriateExpressionException
, meaning that it cannot be a set
expression.
OgnlException
public boolean isNodeConstant(OgnlContext context) throws OgnlException
OgnlException
public boolean isConstant(OgnlContext context) throws OgnlException
OgnlException
public boolean isNodeSimpleProperty(OgnlContext context) throws OgnlException
OgnlException
public boolean isSimpleProperty(OgnlContext context) throws OgnlException
OgnlException
public boolean isSimpleNavigationChain(OgnlContext context) throws OgnlException
OgnlException
public boolean isEvalChain(OgnlContext context) throws OgnlException
OgnlException
protected boolean lastChild(OgnlContext context)
protected void flattenTree()
public ExpressionAccessor getAccessor()
Node
getAccessor
in interface Node
public void setAccessor(ExpressionAccessor accessor)
Node
setAccessor
in interface Node
accessor
- The compiled representation of this node.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |