D
- - type of tree node@Beta public class ChoiceNodeCodecContext<D extends TreeNode> extends DataContainerCodecContext<D,org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode>
NodeCodecContext.CodecContextFactory
Constructor and Description |
---|
ChoiceNodeCodecContext(DataContainerCodecPrototype<org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode> prototype)
Prepare context for choice node from prototype and all case children of choice class.
|
Modifier and Type | Method and Description |
---|---|
D |
deserialize(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> data)
Converts from Normalized Node to Binding representation of data.
|
protected Object |
deserializeObject(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode) |
TreeArgument<?> |
deserializePathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg)
Deserializes path argument for current node.
|
DataContainerCodecContext<?,?> |
getCaseByChildClass(Class<? extends TreeNode> type) |
Map<Class<?>,DataContainerCodecPrototype<?>> |
getClassCaseChildren()
Gets the map of case class and prototype for
TreeNodeCodecContext
to catch choice/cases' data child by class. |
Map<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument,DataContainerCodecPrototype<?>> |
getYangCaseChildren()
Gets the map of case path argument and prototype for
TreeNodeCodecContext
to catch choice/cases' data child by class. |
<C extends TreeNode> |
possibleStreamChild(Class<C> childClass)
Returns child context as if it was walked by
BindingStreamEventWriter . |
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument |
serializePathArgument(TreeArgument<?> arg)
Serializes path argument for current node.
|
<C extends TreeNode> |
streamChild(Class<C> childClass)
Returns child context as if it was walked by
BindingStreamEventWriter . |
NodeCodecContext<?> |
yangPathArgumentChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg)
Returns nested node context using supplied YANG Instance Identifier.
|
bindingArg, bindingPathArgumentChild, childNonNull, childNonNull, childNonNull, createCachingCodec, createWriter, eventStreamSerializer, factory, getBindingClass, getBindingPathArgument, getDomPathArgument, getSchema, namespace, serialize, toString, writeAsNormalizedNode
addYangPathArgument
public ChoiceNodeCodecContext(DataContainerCodecPrototype<org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode> prototype)
prototype
- - codec prototype of choice node@Nonnull public <C extends TreeNode> DataContainerCodecContext<C,?> streamChild(@Nonnull Class<C> childClass)
DataContainerCodecContext
BindingStreamEventWriter
. This means that to enter case, one
must issue getChild(ChoiceClass).getChild(CaseClass).streamChild
in interface BindingTreeNodeCodec<D extends TreeNode>
streamChild
in class DataContainerCodecContext<D extends TreeNode,org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode>
C
- data typechildClass
- input child classpublic <C extends TreeNode> Optional<DataContainerCodecContext<C,?>> possibleStreamChild(@Nonnull Class<C> childClass)
DataContainerCodecContext
BindingStreamEventWriter
. This means that to enter
case, one must issue getChild(ChoiceClass).getChild(CaseClass).possibleStreamChild
in interface BindingTreeNodeCodec<D extends TreeNode>
possibleStreamChild
in class DataContainerCodecContext<D extends TreeNode,org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode>
C
- data typechildClass
- input child classpublic Map<Class<?>,DataContainerCodecPrototype<?>> getClassCaseChildren()
TreeNodeCodecContext
to catch choice/cases' data child by class.public Map<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument,DataContainerCodecPrototype<?>> getYangCaseChildren()
TreeNodeCodecContext
to catch choice/cases' data child by class.public DataContainerCodecContext<?,?> getCaseByChildClass(@Nonnull Class<? extends TreeNode> type)
@Nonnull public NodeCodecContext<?> yangPathArgumentChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg)
DataContainerCodecContext
yangPathArgumentChild
in interface BindingTreeNodeCodec<D extends TreeNode>
yangPathArgumentChild
in class DataContainerCodecContext<D extends TreeNode,org.opendaylight.yangtools.yang.model.api.ChoiceSchemaNode>
arg
- Yang Instance Identifier Argument@Nonnull public D deserialize(@Nonnull org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> data)
BindingNormalizedNodeCodec
data
- - Normalized Node representation of dataprotected Object deserializeObject(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
deserializeObject
in class NodeCodecContext<D extends TreeNode>
@Nonnull public TreeArgument<?> deserializePathArgument(@Nonnull org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg)
BindingTreeNodeCodec
arg
- - Yang Path Argument, may be null if Yang Instance Identifier
does not have representation for current node (e.g. case)@Nonnull public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument serializePathArgument(@Nonnull TreeArgument<?> arg)
BindingTreeNodeCodec
arg
- - Binding Path Argument, may be null if Binding Instance
Identifier does not have representation for current node (e.g.
choice or case)Copyright © 2019 OpenDaylight. All rights reserved.