|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectantlr.BaseAST
antlr.CommonAST
org.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST
org.apache.jdo.impl.jdoql.tree.NodeImpl
org.apache.jdo.impl.jdoql.tree.Expr
org.apache.jdo.impl.jdoql.tree.IdentifierExpr
org.apache.jdo.impl.jdoql.tree.FieldAccessExpr
This node represents a field access expression. Field access expressions have exactly one child, the target expression. This expression can be an arbitrary expression.
Field Summary | |
(package private) java.lang.reflect.Field |
field
|
(package private) java.lang.String |
fieldName
|
(package private) JavaField |
javaField
|
Fields inherited from class org.apache.jdo.impl.jdoql.tree.NodeImpl |
children, clazz, msg, object, parent |
Fields inherited from class org.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST |
column, line, typeInfo |
Fields inherited from class antlr.CommonAST |
|
Fields inherited from class antlr.BaseAST |
down, right |
Constructor Summary | |
|
FieldAccessExpr()
The noarg constructor is needed for ANTLR support and deserialization. |
(package private) |
FieldAccessExpr(Expression target,
java.lang.String fieldName)
This constructor is called by the query tree instance. |
(package private) |
FieldAccessExpr(int tokenType,
java.lang.String name,
java.lang.Class clazz)
This constructor is called by StaticFieldAccessExpr . |
|
FieldAccessExpr(antlr.Token token)
The noarg constructor is needed for ANTLR support. |
Method Summary | |
void |
arrive(NodeVisitor visitor)
Delegates to the argument visitor . |
private java.lang.reflect.Field |
getField()
|
(package private) JavaField |
getFieldInfo()
Returns the model's field object assciated with this instance. |
java.lang.Object |
getFieldValue(javax.jdo.PersistenceManager pm,
java.lang.Object object)
Returns the value of the field corresponding with this field access expression for the argument object . |
java.lang.String |
getName()
Returns the name of the accessed field. |
Expression |
getTarget()
Returns the target expression of this field access. |
(package private) void |
init(Expression target,
java.lang.String fieldName)
Initializes fields of this . |
java.lang.Object |
leave(NodeVisitor visitor,
java.lang.Object[] results)
Delegates to the argument visitor . |
void |
setName(java.lang.String fieldName)
Sets the name of the accessed field. |
Methods inherited from class org.apache.jdo.impl.jdoql.tree.IdentifierExpr |
getTypeName |
Methods inherited from class org.apache.jdo.impl.jdoql.tree.NodeImpl |
ASTToChildren, clone, getChildren, getJavaClass, getObject, getParent, getTokenType, setChildren, setObject, setParent, toString, walkNextChild |
Methods inherited from class org.apache.jdo.impl.jdoql.jdoqlc.JDOQLAST |
getColumn, getLine, getTypeInfo, initialize, initialize, initialize, setColumn, setLine, setTypeInfo, treeToString |
Methods inherited from class antlr.CommonAST |
getText, getType, initialize, setText, setType |
Methods inherited from class antlr.BaseAST |
addChild, decode, encode, equals, equalsList, equalsListPartial, equalsTree, equalsTreePartial, findAll, findAllPartial, getFirstChild, getNextSibling, getNumberOfChildren, getTokenNames, removeChildren, setFirstChild, setNextSibling, setVerboseStringConversion, toStringList, toStringTree, xmlSerialize, xmlSerializeNode, xmlSerializeRootClose, xmlSerializeRootOpen |
Methods inherited from class java.lang.Object |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.apache.jdo.jdoql.tree.IdentifierExpression |
getTypeName |
Methods inherited from interface org.apache.jdo.jdoql.tree.Node |
getChildren, getJavaClass, getObject, getParent, getTokenType, setObject, setParent, walkNextChild |
Field Detail |
java.lang.String fieldName
transient JavaField javaField
transient java.lang.reflect.Field field
Constructor Detail |
public FieldAccessExpr()
setChildren
optionally.
public FieldAccessExpr(antlr.Token token)
setChildren
optionally.
FieldAccessExpr(int tokenType, java.lang.String name, java.lang.Class clazz)
StaticFieldAccessExpr
.
The caller must make sure to set the ANTLR tree structure himself
or, call setChildren
optionally.
tokenType
- the token typename
- the name of this identifierclazz
- the Java type of this identifierFieldAccessExpr(Expression target, java.lang.String fieldName)
target
- the target expressionfieldName
- the field name of this field access expressionMethod Detail |
public java.lang.String getName()
getName
in interface IdentifierExpression
getName
in class IdentifierExpr
public void setName(java.lang.String fieldName)
fieldName
- the field namepublic Expression getTarget()
ThisExpression
or an instance of an arbitrary other
Expression
, e.g. FieldAccessExpression
.
getTarget
in interface FieldAccessExpression
public java.lang.Object getFieldValue(javax.jdo.PersistenceManager pm, java.lang.Object object)
object
.
Note: If the field value is obtained via reflection and
the reflection call throws an IllegalAccessException
,
then undefined is returned.
getFieldValue
in interface FieldAccessExpression
pm
- the persistence manager of the queryobject
- the instance for which to return the field value
object
JDOQueryException
- if the access to the desired field is deniedpublic void arrive(NodeVisitor visitor)
visitor
.
arrive
in interface Node
arrive
in class IdentifierExpr
visitor
- the node visitorpublic java.lang.Object leave(NodeVisitor visitor, java.lang.Object[] results)
visitor
.
leave
in interface Node
leave
in class IdentifierExpr
visitor
- the node visitorresults
- the result array
void init(Expression target, java.lang.String fieldName)
this
.
target
- the target expression of this field accessfieldName
- the name of the field to accessJavaField getFieldInfo()
null
,
then it is computed by this method.
JDOQueryException
- if the access to the desired field is deniedprivate java.lang.reflect.Field getField()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |