public abstract class SimpleNode extends Object implements Node, Serializable
| Modifier and Type | Field and Description |
|---|---|
protected Node[] |
_children |
protected int |
_id |
protected Node |
_parent |
protected OgnlParser |
_parser |
| Constructor and Description |
|---|
SimpleNode(int i) |
SimpleNode(OgnlParser p,
int i) |
| Modifier and Type | Method and Description |
|---|---|
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 |
isChain(OgnlContext context) |
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 |
isOperation(OgnlContext context) |
boolean |
isSequence(OgnlContext context) |
boolean |
isSimpleMethod(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) |
protected Node _parent
protected Node[] _children
protected int _id
protected OgnlParser _parser
public SimpleNode(int i)
public SimpleNode(OgnlParser p, int i)
public void jjtOpen()
Nodepublic void jjtClose()
Nodepublic void jjtSetParent(Node n)
NodejjtSetParent in interface Nodepublic Node jjtGetParent()
jjtGetParent in interface Nodepublic void jjtAddChild(Node n, int i)
NodejjtAddChild in interface Nodepublic Node jjtGetChild(int i)
NodejjtGetChild in interface Nodepublic int jjtGetNumChildren()
NodejjtGetNumChildren in interface Nodepublic String toGetSourceString(OgnlContext context, Object target)
JavaSourceExpressionAccessor.get(OgnlContext, Object) calls.toGetSourceString in interface JavaSourcepublic String toSetSourceString(OgnlContext context, Object target)
JavaSourceExpressionAccessor.get(OgnlContext, Object) calls.toSetSourceString in interface JavaSourcepublic void dump(PrintWriter writer, String prefix)
public int getIndexInParent()
public Node getNextSibling()
protected Object evaluateGetValueBody(OgnlContext context, Object source) throws OgnlException
OgnlExceptionprotected void evaluateSetValueBody(OgnlContext context, Object target, Object value) throws OgnlException
OgnlExceptionpublic final Object getValue(OgnlContext context, Object source) throws OgnlException
NodegetValue in interface NodeOgnlExceptionprotected abstract Object getValueBody(OgnlContext context, Object source) throws OgnlException
OgnlExceptionpublic final void setValue(OgnlContext context, Object target, Object value) throws OgnlException
NodesetValue in interface NodeOgnlExceptionprotected void setValueBody(OgnlContext context, Object target, Object value) throws OgnlException
InappropriateExpressionException, meaning that it cannot be a set expression.OgnlExceptionpublic boolean isNodeConstant(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isConstant(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isNodeSimpleProperty(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isSimpleProperty(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isSimpleNavigationChain(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isEvalChain(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isSequence(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isOperation(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isChain(OgnlContext context) throws OgnlException
OgnlExceptionpublic boolean isSimpleMethod(OgnlContext context) throws OgnlException
OgnlExceptionprotected boolean lastChild(OgnlContext context)
protected void flattenTree()
public ExpressionAccessor getAccessor()
NodegetAccessor in interface Nodepublic void setAccessor(ExpressionAccessor accessor)
NodesetAccessor in interface Nodeaccessor - The compiled representation of this node.Copyright © 1997–2018 OpenSymphony. All rights reserved.