Module dev.metaschema.databind
Package dev.metaschema.databind.io.yaml
Class DefaultYamlSerializer<CLASS extends dev.metaschema.core.model.IBoundObject>
java.lang.Object
dev.metaschema.databind.io.AbstractSerializer<CLASS>
dev.metaschema.databind.io.json.DefaultJsonSerializer<CLASS>
dev.metaschema.databind.io.yaml.DefaultYamlSerializer<CLASS>
- Type Parameters:
CLASS- the Java type of the bound object to serialize
- All Implemented Interfaces:
dev.metaschema.core.configuration.IConfiguration<SerializationFeature<?>>,dev.metaschema.core.configuration.IMutableConfiguration<SerializationFeature<?>>,ISerializer<CLASS>
public class DefaultYamlSerializer<CLASS extends dev.metaschema.core.model.IBoundObject>
extends DefaultJsonSerializer<CLASS>
Serializes bound Java objects to YAML content.
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultYamlSerializer(IBoundDefinitionModelAssembly definition) Construct a new YAML serializer that will generate YAML content based on data in the bound class identified by theclassBinding. -
Method Summary
Modifier and TypeMethodDescription<V> Vget(SerializationFeature<?> feature) protected IBindingContextRetrieve the binding context associated with the serializer.protected dev.metaschema.core.configuration.IMutableConfiguration<SerializationFeature<?>>Get the current configuration of the serializer/deserializer.protected IBoundDefinitionModelAssemblyRetrieve the bound class information associated with the assembly that the serializer/deserializer will write/read data from.booleanisFeatureEnabled(SerializationFeature<?> feature) protected com.fasterxml.jackson.core.JsonFactoryConstructs a new JSON factory.Methods inherited from class dev.metaschema.databind.io.json.DefaultJsonSerializer
configurationChanged, resetFactory, serializeMethods inherited from class dev.metaschema.databind.io.AbstractSerializer
applyConfiguration, disableFeature, enableFeature, setMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface dev.metaschema.core.configuration.IConfiguration
get, getFeatureValues, isFeatureEnabledMethods inherited from interface dev.metaschema.databind.io.ISerializer
serialize, serialize, serialize
-
Constructor Details
-
DefaultYamlSerializer
Construct a new YAML serializer that will generate YAML content based on data in the bound class identified by theclassBinding.- Parameters:
definition- the bound class information for the Java type this serializer is operating on
-
-
Method Details
-
newFactoryInstance
Description copied from class:DefaultJsonSerializerConstructs a new JSON factory.Subclasses can override this method to create a JSON factory with a specific configuration.
- Overrides:
newFactoryInstancein classDefaultJsonSerializer<CLASS extends dev.metaschema.core.model.IBoundObject>- Returns:
- the factory
-
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
-
getConfiguration
@NonNull protected dev.metaschema.core.configuration.IMutableConfiguration<SerializationFeature<?>> getConfiguration()Get the current configuration of the serializer/deserializer.- Returns:
- the configuration
-
isFeatureEnabled
- Specified by:
isFeatureEnabledin interfacedev.metaschema.core.configuration.IConfiguration<T extends dev.metaschema.core.configuration.IConfigurationFeature<?>>
-
getFeatureValues
- Specified by:
getFeatureValuesin interfacedev.metaschema.core.configuration.IConfiguration<T extends dev.metaschema.core.configuration.IConfigurationFeature<?>>
-
get
- Specified by:
getin interfacedev.metaschema.core.configuration.IConfiguration<T extends dev.metaschema.core.configuration.IConfigurationFeature<?>>
-