Class DefaultYamlSerializer<CLASS>
- java.lang.Object
-
- gov.nist.secauto.metaschema.databind.io.AbstractSerializer<CLASS>
-
- gov.nist.secauto.metaschema.databind.io.json.DefaultJsonSerializer<CLASS>
-
- gov.nist.secauto.metaschema.databind.io.yaml.DefaultYamlSerializer<CLASS>
-
- All Implemented Interfaces:
IConfiguration<SerializationFeature<?>>
,IMutableConfiguration<SerializationFeature<?>>
,ISerializer<CLASS>
public class DefaultYamlSerializer<CLASS> extends DefaultJsonSerializer<CLASS>
-
-
Constructor Summary
Constructors Constructor Description DefaultYamlSerializer(IAssemblyClassBinding classBinding)
Construct a new YAML serializer that will generate YAML content based on data in the bound class identified by theclassBinding
.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> V
get(T feature)
protected IBindingContext
getBindingContext()
Retrieve the binding context associated with the serializer.protected IAssemblyClassBinding
getClassBinding()
Retrieve the bound class information associated with the assembly that the serializer/deserializer will write/read data from.protected IMutableConfiguration<T>
getConfiguration()
Get the current configuration of the serializer/deserializer.Map<T,Object>
getFeatureValues()
protected com.fasterxml.jackson.core.JsonFactory
getJsonFactoryInstance()
Constructs a new JSON factory.boolean
isFeatureEnabled(T feature)
-
Methods inherited from class gov.nist.secauto.metaschema.databind.io.json.DefaultJsonSerializer
configurationChanged, serialize
-
Methods inherited from class gov.nist.secauto.metaschema.databind.io.AbstractSerializer
applyConfiguration, disableFeature, enableFeature, set
-
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
-
-
-
-
Constructor Detail
-
DefaultYamlSerializer
public DefaultYamlSerializer(@NonNull IAssemblyClassBinding classBinding)
Construct a new YAML serializer that will generate YAML content based on data in the bound class identified by theclassBinding
.- Parameters:
classBinding
- the bound class information for the Java type this serializer is operating on
-
-
Method Detail
-
getJsonFactoryInstance
protected com.fasterxml.jackson.core.JsonFactory getJsonFactoryInstance()
Description copied from class:DefaultJsonSerializer
Constructs a new JSON factory.Subclasses can override this method to create a JSON factory with a specific configuration.
- Overrides:
getJsonFactoryInstance
in classDefaultJsonSerializer<CLASS>
- Returns:
- the factory
-
getBindingContext
@NonNull protected IBindingContext getBindingContext()
Retrieve the binding context associated with the serializer.- Returns:
- the binding context
-
getClassBinding
@NonNull protected IAssemblyClassBinding getClassBinding()
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
-
getConfiguration
@NonNull protected IMutableConfiguration<T> getConfiguration()
Get the current configuration of the serializer/deserializer.- Returns:
- the configuration
-
isFeatureEnabled
public boolean isFeatureEnabled(T feature)
- Specified by:
isFeatureEnabled
in interfaceIConfiguration<T extends IConfigurationFeature<?>>
-
getFeatureValues
public Map<T,Object> getFeatureValues()
- Specified by:
getFeatureValues
in interfaceIConfiguration<T extends IConfigurationFeature<?>>
-
get
public <V> V get(T feature)
- Specified by:
get
in interfaceIConfiguration<T extends IConfigurationFeature<?>>
-
-