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 |
isConstant(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) |
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()
Node
public void jjtClose()
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 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
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.Copyright © 1997–2021 The Apache Software Foundation. All rights reserved.