-
- All Known Subinterfaces:
- Path.BeanNode, Path.ConstructorNode, Path.CrossParameterNode, Path.MethodNode, Path.ParameterNode, Path.PropertyNode, Path.ReturnValueNode
- Enclosing interface:
- Path
public static interface Path.Node
Represents an element of a navigation path.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description <T extends Path.Node>
Tas(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
-
getName
String getName()
Returns the name of the element which the node represents:null
if it is a leaf node which represents an entity / bean. In particular, the node representing the root object.- The property name for a property.
- The method name for a method.
- The unqualified name of the type declaring the constructor for a constructor.
- The parameter named as defined by the
ParameterNameProvider
for a method or constructor parameter. - The literal
<cross-parameter>
for a method or constructor cross-parameter. - The literal
<return value>
for a method or constructor return value.
- Returns:
- name of the element which the node represents
-
isInIterable
boolean isInIterable()
- Returns:
true
if the node represents an object contained in anIterable
or in aMap
,false
otherwise
-
getIndex
Integer getIndex()
- Returns:
- the index the node is placed in if contained in an array or
List
;null
otherwise
-
getKey
Object getKey()
- Returns:
- the key the node is placed in if contained in a
Map
,null
otherwise
-
getKind
ElementKind getKind()
The kind of element represented by the node. The following relationship between anElementKind
and itsNode
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
Node
type and access node specific information:switch(node.getKind() { case METHOD: name = node.getName(); params = node.as(MethodNode.class).getParameterTypes(); case PARAMETER: index = node.as(ParameterNode.class).getParameterIndex(); [...] }
- Returns:
- the
ElementKind
- Since:
- 1.1
-
as
<T extends Path.Node> T as(Class<T> nodeType)
Narrows the type of this node down to the given type. The appropriate type should be checked before by callinggetKind()
.- Type Parameters:
T
- the type to narrow down to- Parameters:
nodeType
- class object representing the descriptor type to narrow down to to- Returns:
- this node narrowed down to the given type.
- Throws:
ClassCastException
- If this node is not assignable to the typeT
- Since:
- 1.1
-
-
Nederlandse vertaling
U hebt gevraagd om deze site in het Nederlands te bezoeken. Voor nu wordt alleen de interface vertaald, maar nog niet alle inhoud.Als je me wilt helpen met vertalingen, is je bijdrage welkom. Het enige dat u hoeft te doen, is u op de site registreren en mij een bericht sturen waarin u wordt gevraagd om u toe te voegen aan de groep vertalers, zodat u de gewenste pagina's kunt vertalen. Een link onderaan elke vertaalde pagina geeft aan dat u de vertaler bent en heeft een link naar uw profiel.
Bij voorbaat dank.
Document heeft de 11/06/2005 gemaakt, de laatste keer de 18/08/2025 gewijzigd
Bron van het afgedrukte document:https://www.gaudry.be/nl/java-api-javaee-rf-javax/validation/Path.Node.html
De infobrol is een persoonlijke site waarvan de inhoud uitsluitend mijn verantwoordelijkheid is. De tekst is beschikbaar onder CreativeCommons-licentie (BY-NC-SA). Meer info op de gebruiksvoorwaarden en de auteur.
Referenties
Deze verwijzingen en links verwijzen naar documenten die geraadpleegd zijn tijdens het schrijven van deze pagina, of die aanvullende informatie kunnen geven, maar de auteurs van deze bronnen kunnen niet verantwoordelijk worden gehouden voor de inhoud van deze pagina.
De auteur van deze site is als enige verantwoordelijk voor de manier waarop de verschillende concepten, en de vrijheden die met de referentiewerken worden genomen, hier worden gepresenteerd. Vergeet niet dat u meerdere broninformatie moet doorgeven om het risico op fouten te verkleinen.