Class AbstractSerializer<CLASS extends IBoundObject>
java.lang.Object
gov.nist.secauto.metaschema.databind.io.AbstractSerializer<CLASS>
- Type Parameters:
CLASS
- the bound class to serialize from
- All Implemented Interfaces:
IConfiguration<SerializationFeature<?>>
,IMutableConfiguration<SerializationFeature<?>>
,ISerializer<CLASS>
- Direct Known Subclasses:
DefaultJsonSerializer
,DefaultXmlSerializer
public abstract class AbstractSerializer<CLASS extends IBoundObject>
extends Object
implements ISerializer<CLASS>
The base class of all format-specific serializers.
-
Constructor Summary
ConstructorDescriptionAbstractSerializer
(IBoundDefinitionModelAssembly definition) Construct a new serializer. -
Method Summary
Modifier and TypeMethodDescriptionapplyConfiguration
(IConfiguration<SerializationFeature<?>> other) protected void
disableFeature
(SerializationFeature<?> feature) enableFeature
(SerializationFeature<?> feature) <V> V
get
(SerializationFeature<?> feature) protected IBindingContext
Retrieve the binding context associated with the serializer.protected IMutableConfiguration<SerializationFeature<?>>
Get the current configuration of the serializer/deserializer.protected IBoundDefinitionModelAssembly
Retrieve the bound class information associated with the assembly that the serializer/deserializer will write/read data from.boolean
isFeatureEnabled
(SerializationFeature<?> feature) set
(SerializationFeature<?> feature, Object value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface gov.nist.secauto.metaschema.core.configuration.IConfiguration
get, getFeatureValues, isFeatureEnabled
Methods inherited from interface gov.nist.secauto.metaschema.databind.io.ISerializer
serialize, serialize, serialize, serialize
-
Constructor Details
-
AbstractSerializer
Construct a new serializer.- Parameters:
definition
- the bound class information for the Java type this serializer is operating on
-
-
Method Details
-
enableFeature
- Specified by:
enableFeature
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
- Specified by:
enableFeature
in interfaceISerializer<CLASS extends IBoundObject>
-
disableFeature
- Specified by:
disableFeature
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
- Specified by:
disableFeature
in interfaceISerializer<CLASS extends IBoundObject>
-
applyConfiguration
public ISerializer<CLASS> applyConfiguration(@NonNull IConfiguration<SerializationFeature<?>> other) - Specified by:
applyConfiguration
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
- Specified by:
applyConfiguration
in interfaceISerializer<CLASS extends IBoundObject>
-
set
- Specified by:
set
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
- Specified by:
set
in interfaceISerializer<CLASS extends IBoundObject>
-
getBindingContext
Retrieve the binding context associated with the serializer.- Returns:
- the binding context
-
getDefinition
Retrieve the bound class information associated with the assembly that the serializer/deserializer will write/read data from.- Returns:
- the class binding for the Module assembly
-
configurationChanged
-
getConfiguration
Get the current configuration of the serializer/deserializer.- Returns:
- the configuration
-
isFeatureEnabled
- Specified by:
isFeatureEnabled
in interfaceIConfiguration<T extends IConfigurationFeature<?>>
-
getFeatureValues
- Specified by:
getFeatureValues
in interfaceIConfiguration<T extends IConfigurationFeature<?>>
-
get
- Specified by:
get
in interfaceIConfiguration<T extends IConfigurationFeature<?>>
-