@Beta public final class AnyxmlNodeCodecContext<D extends TreeNode> extends NodeCodecContext<D>
NodeCodecContext.CodecContextFactory
Modifier and Type | Method and Description |
---|---|
BindingTreeNodeCodec<?> |
bindingPathArgumentChild(TreeArgument<?> arg,
List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> builder)
Returns nested node context using supplied Binding Instance Identifier
and adds YANG instance identifiers to supplied list.
|
BindingNormalizedNodeCachingCodec<D> |
createCachingCodec(com.google.common.collect.ImmutableCollection<Class<? extends TreeNode>> cacheSpecifier)
Returns codec which uses caches serialization / deserialization results.
|
D |
deserialize(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
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.
|
NodeCodecContext<?> |
get() |
Class<D> |
getBindingClass()
Returns binding class of interface which represents API of current schema
node.
|
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument |
getDomPathArgument()
Returns Yang Instance Identifier Path Argument of current node.
|
Method |
getGetter() |
org.opendaylight.yangtools.yang.model.api.DataSchemaNode |
getSchema()
Return schema of node codec context.
|
org.opendaylight.yangtools.concepts.Codec<Object,Object> |
getValueCodec() |
<E extends TreeNode> |
possibleStreamChild(Class<E> childClass)
Returns child context as if it was walked by
BindingStreamEventWriter . |
org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> |
serialize(D data)
Converts from Binding to Normalized Node representation of data.
|
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument |
serializePathArgument(TreeArgument arg)
Serializes path argument for current node.
|
<E extends TreeNode> |
streamChild(Class<E> childClass)
Returns child context as if it was walked by
BindingStreamEventWriter . |
void |
writeAsNormalizedNode(D data,
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter writer)
Writes data representing object to supplied stream.
|
BindingTreeNodeCodec<?> |
yangPathArgumentChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child)
Returns nested node context using supplied YANG Instance Identifier.
|
addYangPathArgument
public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument getDomPathArgument()
NodeCodecContext
getDomPathArgument
in class NodeCodecContext<D extends TreeNode>
@Nonnull public D deserialize(@Nonnull org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
BindingNormalizedNodeCodec
deserialize
in interface BindingNormalizedNodeCodec<D extends TreeNode>
normalizedNode
- - Normalized Node representation of data@Nonnull public NodeCodecContext<?> get()
public Method getGetter()
@Nonnull public BindingTreeNodeCodec<?> bindingPathArgumentChild(@Nonnull TreeArgument<?> arg, List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> builder)
BindingTreeNodeCodec
bindingPathArgumentChild
in interface BindingTreeNodeCodec<D extends TreeNode>
arg
- - Binding Instance Identifier Argumentbuilder
- - mutable instance of list, which is appended by
YangInstanceIdentifiers as tree is walked, use null if such
side-product is not needed@Nonnull public BindingNormalizedNodeCachingCodec<D> createCachingCodec(@Nonnull com.google.common.collect.ImmutableCollection<Class<? extends TreeNode>> cacheSpecifier)
BindingTreeNodeCodec
Caching may introduce performance penalty to serialization / deserialization but may decrease use of heap for repetitive objects.
createCachingCodec
in interface BindingTreeNodeCodec<D extends TreeNode>
cacheSpecifier
- - set of objects, for which cache may be in place@Nonnull public Class<D> getBindingClass()
BindingTreeNodeCodec
getBindingClass
in interface BindingTreeNodeCodec<D extends TreeNode>
@Nonnull public org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> serialize(@Nonnull D data)
BindingNormalizedNodeCodec
serialize
in interface BindingNormalizedNodeCodec<D extends TreeNode>
data
- - Binding representation of datapublic void writeAsNormalizedNode(D data, org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter writer)
BindingTreeNodeCodec
writeAsNormalizedNode
in interface BindingTreeNodeCodec<D extends TreeNode>
data
- - representing objectwriter
- - supplied stream@Nonnull public <E extends TreeNode> BindingTreeNodeCodec<E> streamChild(@Nonnull Class<E> childClass)
BindingTreeNodeCodec
BindingStreamEventWriter
. This means that to enter case, one must
issue getChild(ChoiceClass).getChild(CaseClass).streamChild
in interface BindingTreeNodeCodec<D extends TreeNode>
E
- data typechildClass
- - child class by Biding Stream navigationpublic <E extends TreeNode> Optional<? extends BindingTreeNodeCodec<E>> possibleStreamChild(@Nonnull Class<E> childClass)
BindingTreeNodeCodec
BindingStreamEventWriter
. This means that to enter case, one must
issue getChild(ChoiceClass).getChild(CaseClass).
This method differs from BindingTreeNodeCodec.streamChild(Class)
, that is less
stricter for interfaces representing augmentation and cases, that may
return BindingTreeNodeCodec
even if augmentation interface
containing same data was supplied and does not represent augmentation of
this node.possibleStreamChild
in interface BindingTreeNodeCodec<D extends TreeNode>
E
- data typechildClass
- - child class by Binding Stream navigation@Nonnull public BindingTreeNodeCodec<?> yangPathArgumentChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child)
BindingTreeNodeCodec
yangPathArgumentChild
in interface BindingTreeNodeCodec<D extends TreeNode>
child
- - Yang Instance Identifier Argumentprotected Object deserializeObject(org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> normalizedNode)
deserializeObject
in class NodeCodecContext<D extends TreeNode>
public TreeArgument deserializePathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg)
BindingTreeNodeCodec
deserializePathArgument
in interface BindingTreeNodeCodec<D extends TreeNode>
arg
- - Yang Path Argument, may be null if Yang Instance Identifier
does not have representation for current node (e.g. case)public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument serializePathArgument(TreeArgument arg)
BindingTreeNodeCodec
serializePathArgument
in interface BindingTreeNodeCodec<D extends TreeNode>
arg
- - Binding Path Argument, may be null if Binding Instance
Identifier does not have representation for current node (e.g.
choice or case)@Nonnull public org.opendaylight.yangtools.yang.model.api.DataSchemaNode getSchema()
BindingTreeNodeCodec
getSchema
in interface BindingTreeNodeCodec<D extends TreeNode>
Object
as schema of specific node contextCopyright © 2019 OpenDaylight. All rights reserved.