public final class StreamWriterGenerator extends Object
AbstractStreamWriterGenerator
which in runtime generates classes implementing
DataObjectSerializerImplementation
interface and are used to serialize Binding DataObject
.
Actual implementation of codecs is done via static methods, which allows for static wiring of codecs. Choice codec
and Augmentable codecs are static properties of parent codec and stateless implementations are used
(ChoiceDispatchSerializer
, AugmentableDispatchSerializer
), which uses registry to dispatch to
concrete item codec.
Modifier and Type | Field and Description |
---|---|
protected static AugmentableDispatchSerializer |
AUGMENTABLE |
protected static String |
SERIALIZE_METHOD_NAME |
Modifier and Type | Method and Description |
---|---|
static DataObjectSerializerGenerator |
create(JavassistUtils utils)
Create a new instance backed by a specific
JavassistUtils instance. |
protected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource |
generateCaseSerializer(GeneratedType type,
org.opendaylight.yangtools.yang.model.api.CaseSchemaNode node)
Generates serializer source for supplied case node, which will read supplied binding type and invoke proper
methods on supplied
BindingStreamEventWriter . |
protected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource |
generateContainerSerializer(GeneratedType type,
org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode node)
Generates serializer source code for supplied container node, which will read supplied binding type and invoke
proper methods on supplied
BindingStreamEventWriter . |
protected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource |
generateMapEntrySerializer(GeneratedType type,
org.opendaylight.yangtools.yang.model.api.ListSchemaNode node)
Generates serializer source for supplied list node, which will read supplied binding type and invoke proper
methods on supplied
BindingStreamEventWriter . |
protected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource |
generateNotificationSerializer(GeneratedType type,
org.opendaylight.yangtools.yang.model.api.NotificationDefinition node)
Generates serializer source for notification node, which will read supplied binding type and invoke proper
methods on supplied
BindingStreamEventWriter . |
protected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource |
generateSerializer(GeneratedType type,
org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode schema)
Generates serializer source for supplied augmentation node, which will read supplied binding type and invoke
proper methods on supplied
BindingStreamEventWriter . |
protected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource |
generateUnkeyedListEntrySerializer(GeneratedType type,
org.opendaylight.yangtools.yang.model.api.ListSchemaNode node)
Generates serializer source for supplied list node, which will read supplied binding type and invoke proper
methods on supplied
BindingStreamEventWriter . |
DataObjectSerializerImplementation |
getSerializer(Class<?> type)
Get a serializer for a particular type.
|
protected String |
loadSerializerFor(Class<?> cls)
Ensure that the serializer class for specified class is loaded and return its name.
|
void |
onBindingRuntimeContextUpdated(BindingRuntimeContext runtime)
Notify the generator that the runtime context has been updated.
|
protected static final String SERIALIZE_METHOD_NAME
protected static final AugmentableDispatchSerializer AUGMENTABLE
public static DataObjectSerializerGenerator create(JavassistUtils utils)
JavassistUtils
instance.utils
- JavassistUtils instance to useprotected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource generateContainerSerializer(GeneratedType type, org.opendaylight.yangtools.yang.model.api.ContainerSchemaNode node)
BindingStreamEventWriter
.
Implementation is required to recursively invoke events for all reachable binding objects.
type
- Binding type of containernode
- Schema of containerprotected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource generateNotificationSerializer(GeneratedType type, org.opendaylight.yangtools.yang.model.api.NotificationDefinition node)
BindingStreamEventWriter
.
Implementation is required to recursively invoke events for all reachable binding objects.
type
- Binding type of notificationnode
- Schema of notificationprotected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource generateCaseSerializer(GeneratedType type, org.opendaylight.yangtools.yang.model.api.CaseSchemaNode node)
BindingStreamEventWriter
.
Implementation is required to recursively invoke events for all reachable binding objects.
type
- Binding type of casenode
- Schema of caseprotected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource generateUnkeyedListEntrySerializer(GeneratedType type, org.opendaylight.yangtools.yang.model.api.ListSchemaNode node)
BindingStreamEventWriter
.
Implementation is required to recursively invoke events for all reachable binding objects.
type
- Binding type of listnode
- Schema of listprotected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource generateSerializer(GeneratedType type, org.opendaylight.yangtools.yang.model.api.AugmentationSchemaNode schema)
BindingStreamEventWriter
.
Implementation is required to recursively invoke events for all reachable binding objects.
type
- Binding type of augmentationschema
- Schema of augmentationprotected org.opendaylight.mdsal.binding.dom.codec.gen.impl.DataObjectSerializerSource generateMapEntrySerializer(GeneratedType type, org.opendaylight.yangtools.yang.model.api.ListSchemaNode node)
BindingStreamEventWriter
.
Implementation is required to recursively invoke events for all reachable binding objects.
type
- Binding type of listnode
- Schema of listpublic final DataObjectSerializerImplementation getSerializer(Class<?> type)
DataObjectSerializerGenerator
getSerializer
in interface DataObjectSerializerGenerator
type
- Type classpublic final void onBindingRuntimeContextUpdated(BindingRuntimeContext runtime)
DataObjectSerializerGenerator
onBindingRuntimeContextUpdated
in interface DataObjectSerializerGenerator
runtime
- New runtime contextCopyright © 2019 OpenDaylight. All rights reserved.