Class DataSchemaContextNode<T extends YangInstanceIdentifier.PathArgument>
java.lang.Object
org.opendaylight.yangtools.concepts.AbstractIdentifiable<T,T>
org.opendaylight.yangtools.concepts.AbstractSimpleIdentifiable<T>
org.opendaylight.yangtools.yang.data.util.DataSchemaContextNode<T>
- Type Parameters:
T
- Path Argument type
- All Implemented Interfaces:
Identifiable<T>
public abstract class DataSchemaContextNode<T extends YangInstanceIdentifier.PathArgument>
extends AbstractSimpleIdentifiable<T>
Schema derived data providing necessary information for mapping between
NormalizedNode
and serialization format defined in RFC6020,
since the mapping is not one-to-one.-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
DataSchemaContextNode
(T identifier, SchemaNode schema) Deprecated, for removal: This API element is subject to removal in a future version. -
Method Summary
Modifier and TypeMethodDescriptionCreate AugmentationIdentifier from an AugmentationSchemaNode.protected abstract @Nullable DataSchemaContextNode<?>
enterChild
(@NonNull QName child, @NonNull SchemaInferenceStack stack) protected abstract @Nullable DataSchemaContextNode<?>
enterChild
(@NonNull YangInstanceIdentifier.PathArgument child, @NonNull SchemaInferenceStack stack) final @Nullable DataSchemaContextNode<?>
enterChild
(SchemaInferenceStack stack, QName child) Attempt to enter a childDataSchemaContextNode
towards theDataSchemaNode
child identified by specifieddata tree
QName
, adjusting providedstack
with inference steps corresponding to the transition to the returned node.final @Nullable DataSchemaContextNode<?>
Attempt to enter a childDataSchemaContextNode
towards theDataSchemaNode
child identified by specifiedYangInstanceIdentifier.PathArgument
, adjusting providedstack
with inference steps corresponding to the transition to the returned node.final @NonNull Optional<@NonNull DataSchemaContextNode<?>>
findChild
(@NonNull YangInstanceIdentifier path) Find a child node as identified by aYangInstanceIdentifier
relative to this node.static @NonNull DataSchemaContextNode<?>
Deprecated, for removal: This API element is subject to removal in a future version.static @Nullable DataSchemaContextNode<?>
fromDataSchemaNode
(DataSchemaNode potential) Deprecated, for removal: This API element is subject to removal in a future version.abstract @Nullable DataSchemaContextNode<?>
Find a child node identifier by its {code data tree}QName
.abstract @Nullable DataSchemaContextNode<?>
Find a child node identifier by itsYangInstanceIdentifier.PathArgument
.@Nullable DataSchemaNode
boolean
abstract boolean
isLeaf()
boolean
isMixin()
This node is aNormalizedNode
intermediate, not represented in RFC7950 XML encoding.protected void
pushToStack
(@NonNull SchemaInferenceStack stack) Push this node into specifiedSchemaInferenceStack
.Methods inherited from class org.opendaylight.yangtools.concepts.AbstractIdentifiable
addToStringAttributes, getIdentifier, toString
-
Constructor Details
-
DataSchemaContextNode
@Deprecated(forRemoval=true, since="8.0.2") protected DataSchemaContextNode(T identifier, SchemaNode schema) Deprecated, for removal: This API element is subject to removal in a future version.
-
-
Method Details
-
isMixin
public boolean isMixin()This node is aNormalizedNode
intermediate, not represented in RFC7950 XML encoding. This is typically one ofAugmentationNode
backed by anAugmentationSchemaNode
, orChoiceNode
backed by aChoiceSchemaNode
, orLeafSetNode
backed by aLeafListSchemaNode
, orMapNode
backed by aListSchemaNode
with a non-emptyListSchemaNode.getKeyDefinition()
, orUnkeyedListNode
backed by aListSchemaNode
with an emptyListSchemaNode.getKeyDefinition()
- Returns:
- false if this node corresponds to an XML element, or
true
if it is an encapsulation node.
-
isKeyedEntry
public boolean isKeyedEntry() -
isLeaf
public abstract boolean isLeaf() -
getQNameIdentifiers
-
getChild
public abstract @Nullable DataSchemaContextNode<?> getChild(YangInstanceIdentifier.PathArgument child) Find a child node identifier by itsYangInstanceIdentifier.PathArgument
.- Parameters:
child
- Child path argument- Returns:
- A child node, or null if not found
-
getChild
Find a child node identifier by its {code data tree}QName
. This method returns intermediate nodes significant fromYangInstanceIdentifier
hierarchy ofYangInstanceIdentifier.PathArgument
s. If the returned node indicatestrue
viaisMixin()
, it represents aNormalizedNode
encapsulation which is not visible in RFC7950 XML encoding, and a further call to this method with the samechild
argument will provide the next step.- Parameters:
child
- Child data tree QName- Returns:
- A child node, or null if not found
-
enterChild
Attempt to enter a childDataSchemaContextNode
towards theDataSchemaNode
child identified by specifieddata tree
QName
, adjusting providedstack
with inference steps corresponding to the transition to the returned node. The stack is expected to be correctly pointing at this node's schema, otherwise the results of this method are undefined.- Parameters:
stack
-SchemaInferenceStack
to updatechild
- Child QName- Returns:
- A DataSchemaContextNode on the path towards the specified child
- Throws:
NullPointerException
- if any argument isnull
-
enterChild
protected abstract @Nullable DataSchemaContextNode<?> enterChild(@NonNull QName child, @NonNull SchemaInferenceStack stack) -
enterChild
public final @Nullable DataSchemaContextNode<?> enterChild(SchemaInferenceStack stack, YangInstanceIdentifier.PathArgument child) Attempt to enter a childDataSchemaContextNode
towards theDataSchemaNode
child identified by specifiedYangInstanceIdentifier.PathArgument
, adjusting providedstack
with inference steps corresponding to the transition to the returned node. The stack is expected to be correctly pointing at this node's schema, otherwise the results of this method are undefined.- Parameters:
stack
-SchemaInferenceStack
to updatechild
- Child path argument- Returns:
- A DataSchemaContextNode for the specified child
- Throws:
NullPointerException
- if any argument isnull
-
enterChild
protected abstract @Nullable DataSchemaContextNode<?> enterChild(@NonNull YangInstanceIdentifier.PathArgument child, @NonNull SchemaInferenceStack stack) -
pushToStack
Push this node into specifiedSchemaInferenceStack
.- Parameters:
stack
-SchemaInferenceStack
-
getDataSchemaNode
-
findChild
public final @NonNull Optional<@NonNull DataSchemaContextNode<?>> findChild(@NonNull YangInstanceIdentifier path) Find a child node as identified by aYangInstanceIdentifier
relative to this node.- Parameters:
path
- Path towards the child node- Returns:
- Child node if present, or empty when corresponding child is not found.
- Throws:
NullPointerException
- ifpath
is null
-
augmentationIdentifierFrom
public static YangInstanceIdentifier.AugmentationIdentifier augmentationIdentifierFrom(AugmentationSchemaNode schema) Create AugmentationIdentifier from an AugmentationSchemaNode.- Parameters:
schema
- Augmentation schema- Returns:
- AugmentationIdentifier for the schema
- Throws:
NullPointerException
- ifschema
is null
-
fromDataSchemaNode
@Deprecated(forRemoval=true, since="8.0.2") public static @Nullable DataSchemaContextNode<?> fromDataSchemaNode(DataSchemaNode potential) Deprecated, for removal: This API element is subject to removal in a future version.Get aDataSchemaContextNode
for a particularDataSchemaNode
.- Parameters:
potential
- Backing DataSchemaNode- Returns:
- A
DataSchemaContextNode
, or null if the input isnull
or of unhandled type
-
from
@Deprecated(forRemoval=true, since="8.0.2") public static @NonNull DataSchemaContextNode<?> from(EffectiveModelContext ctx) Deprecated, for removal: This API element is subject to removal in a future version.Return a DataSchemaContextNode corresponding to specifiedEffectiveModelContext
.- Parameters:
ctx
- EffectiveModelContext- Returns:
- A DataSchemaContextNode
- Throws:
NullPointerException
- ifctx
is null
-
DataSchemaContextTree.from(EffectiveModelContext)
andDataSchemaContextTree.getRoot()
instead.