@Beta public abstract class DataContainerCodecContext<D extends TreeNode,T> extends NodeCodecContext<D>
NodeCodecContext.CodecContextFactory
Modifier | Constructor and Description |
---|---|
protected |
DataContainerCodecContext(DataContainerCodecPrototype<T> prototype) |
Modifier and Type | Method and Description |
---|---|
protected TreeArgument |
bindingArg() |
DataContainerCodecContext<?,?> |
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.
|
protected <V> V |
childNonNull(V nullable,
Class<?> childClass,
String message,
Object... args) |
protected <V> V |
childNonNull(V nullable,
org.opendaylight.yangtools.yang.common.QName child,
String message,
Object... args) |
protected <V> V |
childNonNull(V nullable,
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child,
String message,
Object... args) |
BindingNormalizedNodeCachingCodec<D> |
createCachingCodec(com.google.common.collect.ImmutableCollection<Class<? extends TreeNode>> cacheSpecifier)
Returns codec which uses caches serialization / deserialization results.
|
BindingStreamEventWriter |
createWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter) |
TreeNodeSerializer |
eventStreamSerializer() |
protected NodeCodecContext.CodecContextFactory |
factory() |
Class<D> |
getBindingClass()
Returns binding class of interface which represents API of current schema
node.
|
protected TreeArgument |
getBindingPathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument domArg)
Returns de-serialized Binding Path Argument from YANG instance identifier.
|
org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument |
getDomPathArgument()
Returns Yang Instance Identifier Path Argument of current node.
|
T |
getSchema()
Return schema of node codec context.
|
protected org.opendaylight.yangtools.yang.common.QNameModule |
namespace() |
abstract <C extends TreeNode> |
possibleStreamChild(Class<C> 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.
|
abstract <C extends TreeNode> |
streamChild(Class<C> childClass)
Returns child context as if it was walked by
BindingStreamEventWriter . |
String |
toString() |
void |
writeAsNormalizedNode(D data,
org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter writer)
Writes data representing object to supplied stream.
|
abstract NodeCodecContext<?> |
yangPathArgumentChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg)
Returns nested node context using supplied YANG Instance Identifier.
|
addYangPathArgument, deserializeObject
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
deserializePathArgument, serializePathArgument
deserialize
protected DataContainerCodecContext(DataContainerCodecPrototype<T> prototype)
@Nonnull public final T getSchema()
BindingTreeNodeCodec
Object
as schema of specific node contextprotected final org.opendaylight.yangtools.yang.common.QNameModule namespace()
protected final NodeCodecContext.CodecContextFactory factory()
public org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument getDomPathArgument()
NodeCodecContext
getDomPathArgument
in class NodeCodecContext<D extends TreeNode>
@Nonnull public abstract NodeCodecContext<?> yangPathArgumentChild(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument arg)
arg
- Yang Instance Identifier ArgumentIllegalArgumentException
- If supplied argument does not represent valid child.@Nonnull public DataContainerCodecContext<?,?> bindingPathArgumentChild(@Nonnull TreeArgument<?> arg, List<org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument> builder)
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 neededarg
does not represent valid child.IllegalArgumentException
- If supplied argument does not represent valid child.protected TreeArgument getBindingPathArgument(org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument domArg)
domArg
- input path argumentprotected final TreeArgument bindingArg()
@Nonnull public final Class<D> getBindingClass()
BindingTreeNodeCodec
@Nonnull public abstract <C extends TreeNode> DataContainerCodecContext<C,?> streamChild(@Nonnull Class<C> childClass) throws IllegalArgumentException
BindingStreamEventWriter
. This means that to enter case, one
must issue getChild(ChoiceClass).getChild(CaseClass).C
- data typechildClass
- input child classIllegalArgumentException
- If supplied child class is not valid in specified context.public abstract <C extends TreeNode> Optional<DataContainerCodecContext<C,?>> possibleStreamChild(@Nonnull Class<C> childClass)
BindingStreamEventWriter
. This means that to enter
case, one must issue getChild(ChoiceClass).getChild(CaseClass).C
- data typechildClass
- input child class@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.
cacheSpecifier
- - set of objects, for which cache may be in placepublic BindingStreamEventWriter createWriter(org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter domWriter)
@Nonnull protected final <V> V childNonNull(@Nullable V nullable, org.opendaylight.yangtools.yang.data.api.YangInstanceIdentifier.PathArgument child, String message, Object... args)
@Nonnull protected final <V> V childNonNull(@Nullable V nullable, org.opendaylight.yangtools.yang.common.QName child, String message, Object... args)
@Nonnull protected final <V> V childNonNull(@Nullable V nullable, Class<?> childClass, String message, Object... args)
public TreeNodeSerializer eventStreamSerializer()
@Nonnull public org.opendaylight.yangtools.yang.data.api.schema.NormalizedNode<?,?> serialize(@Nonnull D data)
BindingNormalizedNodeCodec
data
- - Binding representation of datapublic void writeAsNormalizedNode(D data, org.opendaylight.yangtools.yang.data.api.schema.stream.NormalizedNodeStreamWriter writer)
BindingTreeNodeCodec
data
- - representing objectwriter
- - supplied streamCopyright © 2019 OpenDaylight. All rights reserved.