Class CommonDataObjectCodecContext<D extends DataObject,T extends CompositeRuntimeType>
java.lang.Object
org.opendaylight.yangtools.binding.data.codec.impl.CommonDataObjectCodecContext<D,T>
- All Implemented Interfaces:
BindingCodecTreeNode
,BindingDataContainerCodecTreeNode<D>
,BindingDataObjectCodecTreeParent<Empty>
,BindingObjectCodecTreeNode
,CommonDataObjectCodecTreeNode<D>
- Direct Known Subclasses:
DataObjectCodecContext
public abstract sealed class CommonDataObjectCodecContext<D extends DataObject,T extends CompositeRuntimeType>
extends Object
implements CommonDataObjectCodecTreeNode<D>
permits DataObjectCodecContext<D,T> (not exhaustive)
Base implementation of
CommonDataObjectCodecTreeNode
, shared between DataObjectCodecContext
and
AugmentationCodecContext
. They share most of their mechanics, but notably:
- DataObjectCodecContext has an exact DistinctNodeContainer and YangInstanceIdentifier mapping and can be the target of augmentations (i.e. can implement Augmentable contract)
- AugmentationNodeContext has neither of those traits and really is just a filter of its parent DistinctNodeContainer
Unfortunately Augmentation
is a also a DataObject
, so things get a bit messy.
While this class is public, it not part of API surface and is an implementation detail. The only reason for it being public is that it needs to be accessible by code generated at runtime.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.opendaylight.yangtools.binding.data.codec.api.BindingDataContainerCodecTreeNode
BindingDataContainerCodecTreeNode.ChildAddressabilitySummary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final DataObjectStep
<?> final CommonDataObjectCodecContext
<?, ?> bindingPathArgumentChild
(DataObjectStep<?> step, List<YangInstanceIdentifier.PathArgument> builder) Returns nested node context using supplied DataObjectStep and adds YANG instance identifiers to the supplied list.protected final <V> @NonNull V
childNonNull
(@Nullable V nullable, Class<?> childClass, String message, Object... args) protected final <V> @NonNull V
childNonNull
(@Nullable V nullable, QName child, String message, Object... args) protected final <V> @NonNull V
childNonNull
(@Nullable V nullable, YangInstanceIdentifier.PathArgument child, String message, Object... args) Returns binding class of interface which represents API of current schema node.protected DataObjectStep
<?> Returns deserialized Binding Path Argument from YANG instance identifier.Return a summary of addressability of potential children.Deprecated, for removal: This API element is subject to removal in a future version.final <C extends DataObject>
org.opendaylight.yangtools.binding.data.codec.impl.DataContainerCodecContext<C, ?, ?> getStreamChild
(Class<C> childClass) Returns child context as if it was walked byBindingStreamEventWriter
.final <C extends DataObject>
org.opendaylight.yangtools.binding.data.codec.impl.DataContainerCodecContext<C, ?, ?> streamChild
(Class<C> childClass) Returns child context as if it was walked byBindingStreamEventWriter
.toString()
org.opendaylight.yangtools.binding.data.codec.impl.CodecContext
Returns nested node context using suppliedYangInstanceIdentifier.PathArgument
.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.opendaylight.yangtools.binding.data.codec.api.BindingDataContainerCodecTreeNode
getBindingClass, getChildAddressabilitySummary, streamAugmentation, streamChild, streamDataObject, yangPathArgumentChild
Methods inherited from interface org.opendaylight.yangtools.binding.data.codec.api.BindingDataObjectCodecTreeParent
getStreamAugmentation, getStreamChild, getStreamDataObject
Methods inherited from interface org.opendaylight.yangtools.binding.data.codec.api.CommonDataObjectCodecTreeNode
deserializePathArgument, serializePathArgument
-
Method Details
-
getSchema
Deprecated, for removal: This API element is subject to removal in a future version.Description copied from interface:BindingCodecTreeNode
Return the schema node associated with this node.- Specified by:
getSchema
in interfaceBindingCodecTreeNode
- Returns:
- A schema node.
-
bindingPathArgumentChild
public final CommonDataObjectCodecContext<?,?> bindingPathArgumentChild(DataObjectStep<?> step, List<YangInstanceIdentifier.PathArgument> builder) Description copied from interface:BindingDataContainerCodecTreeNode
Returns nested node context using supplied DataObjectStep and adds YANG instance identifiers to the supplied list.- Specified by:
bindingPathArgumentChild
in interfaceBindingDataContainerCodecTreeNode<D extends DataObject>
- Parameters:
step
- ADataObjectStep
builder
- a mutable List to receiveYangInstanceIdentifier.PathArgument
s. Usenull
if such side-product is not needed.- Returns:
- A
CommonDataObjectCodecTreeNode
-
getBindingPathArgument
Returns deserialized Binding Path Argument from YANG instance identifier. -
bindingArg
-
getBindingClass
Description copied from interface:BindingDataContainerCodecTreeNode
Returns binding class of interface which represents API of current schema node. The result is same as invokingBindingContract.implementedInterface()
on instance of data.- Specified by:
getBindingClass
in interfaceBindingDataContainerCodecTreeNode<D extends DataContainer>
- Specified by:
getBindingClass
in interfaceBindingObjectCodecTreeNode
- Returns:
- interface which defines API of binding representation of data.
-
getChildAddressabilitySummary
public final BindingDataContainerCodecTreeNode.ChildAddressabilitySummary getChildAddressabilitySummary()Description copied from interface:BindingDataContainerCodecTreeNode
Return a summary of addressability of potential children. Binding specification does not allow all DOM tree elements to be directly addressed, which means some recursive tree operations, like data tree changes do not have a one-to-one mapping from DOM to binding in all cases. This method provides an optimization hint to guide translation of data structures, allowing for fast paths when all children are known to either be addressable or non-addressable.- Specified by:
getChildAddressabilitySummary
in interfaceBindingDataContainerCodecTreeNode<D extends DataContainer>
- Returns:
- Summary children addressability.
-
yangPathArgumentChild
public org.opendaylight.yangtools.binding.data.codec.impl.CodecContext yangPathArgumentChild(YangInstanceIdentifier.PathArgument arg) Description copied from interface:BindingDataContainerCodecTreeNode
Returns nested node context using suppliedYangInstanceIdentifier.PathArgument
.- Specified by:
yangPathArgumentChild
in interfaceBindingDataContainerCodecTreeNode<D extends DataContainer>
- Parameters:
arg
- aYangInstanceIdentifier.PathArgument
- Returns:
- Context of child
-
getStreamChild
public final <C extends DataObject> org.opendaylight.yangtools.binding.data.codec.impl.DataContainerCodecContext<C,?, getStreamChild?> (Class<C> childClass) Description copied from interface:BindingDataObjectCodecTreeParent
Returns child context as if it was walked byBindingStreamEventWriter
. This means that to enter case, one must issuegetStreamChild(ChoiceClass).getStreamChild(CaseClass)
.- Specified by:
getStreamChild
in interfaceBindingDataObjectCodecTreeParent<D extends DataContainer>
- Type Parameters:
C
- Stream child DataObject type- Parameters:
childClass
- Child class by Binding Stream navigation- Returns:
- Context of child
-
streamChild
public final <C extends DataObject> org.opendaylight.yangtools.binding.data.codec.impl.DataContainerCodecContext<C,?, streamChild?> (Class<C> childClass) Description copied from interface:BindingDataContainerCodecTreeNode
Returns child context as if it was walked byBindingStreamEventWriter
. This means that to enter case, one must issue getChild(ChoiceClass).getChild(CaseClass).This method differs from
BindingDataObjectCodecTreeParent.getStreamChild(Class)
, that is less strict for interfaces representing augmentation and cases, that may returnBindingCodecTreeNode
even if augmentation interface containing same data was supplied and does not represent augmentation of this node.- Specified by:
streamChild
in interfaceBindingDataContainerCodecTreeNode<D extends DataContainer>
- Parameters:
childClass
- Child class by Binding Stream navigation- Returns:
- Context of child or
null
is supplied class is not applicable in context.
-
toString
-
childNonNull
protected final <V> @NonNull V childNonNull(@Nullable V nullable, YangInstanceIdentifier.PathArgument child, String message, Object... args) -
childNonNull
-
childNonNull
-