|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public static interface Path.Node
Represents an element of a navigation path.
Method Summary | ||
---|---|---|
|
as(Class<T> nodeType)
Narrows the type of this node down to the given type. |
|
Integer |
getIndex()
|
|
Object |
getKey()
|
|
ElementKind |
getKind()
The kind of element represented by the node. |
|
String |
getName()
Returns the name of the element which the node represents: null if it is a leaf node which represents an entity / bean. |
|
boolean |
isInIterable()
|
Method Detail |
---|
String getName()
null
if it is a leaf node which represents an entity / bean.
In particular, the node representing the root object.ParameterNameProvider
for a method or constructor parameter.<cross-parameter>
for a method or constructor
cross-parameter.<return value>
for a method or constructor return
value.
boolean isInIterable()
true
if the node represents an object contained in an
Iterable
or in a Map, false
otherwise.Integer getIndex()
List
. null
otherwise.Object getKey()
Map
.
null
otherwise.ElementKind getKind()
ElementKind
and its Node
subtype exists:
ElementKind.BEAN
: Path.BeanNode
ElementKind.PROPERTY
: Path.PropertyNode
ElementKind.METHOD
: Path.MethodNode
ElementKind.CONSTRUCTOR
: Path.ConstructorNode
ElementKind.PARAMETER
: Path.ParameterNode
ElementKind.CROSS_PARAMETER
: Path.CrossParameterNode
ElementKind.RETURN_VALUE
: Path.ReturnValueNode
switch(node.getKind() {
case METHOD:
name = node.getName();
params = node.as(MethodNode.class).getParameterTypes();
case PARAMETER:
index = node.as(ParameterNode.class).getParameterIndex();
[...]
}
<T extends Path.Node> T as(Class<T> nodeType)
getKind()
.
T
- The type to narrow down tonodeType
- Class object representing the descriptor type to narrow down
to.
ClassCastException
- If this node is not assignable to the type T
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |