Class DefaultXmlDeserializer<CLASS>
- java.lang.Object
-
- gov.nist.secauto.metaschema.databind.io.AbstractDeserializer<CLASS>
-
- gov.nist.secauto.metaschema.databind.io.xml.DefaultXmlDeserializer<CLASS>
-
- All Implemented Interfaces:
IConfiguration<DeserializationFeature<?>>
,IMutableConfiguration<DeserializationFeature<?>>
,IDeserializer<CLASS>
public class DefaultXmlDeserializer<CLASS> extends AbstractDeserializer<CLASS>
-
-
Constructor Summary
Constructors Constructor Description DefaultXmlDeserializer(IAssemblyClassBinding classBinding)
Construct a new Module binding-based deserializer that reads XML-based Module content.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
configurationChanged(IMutableConfiguration<T> config)
protected IDocumentNodeItem
deserializeToNodeItemInternal(Reader reader, URI documentUri)
This abstract method delegates parsing to the concrete implementation.CLASS
deserializeToValue(Reader reader, URI documentUri)
Read data from theReader
into a node item instance.<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()
boolean
isFeatureEnabled(T feature)
protected void
setXMLInputFactory(org.codehaus.stax2.XMLInputFactory2 factory)
Provide a XML input factory instance that will be used to create XML parser instances.-
Methods inherited from class gov.nist.secauto.metaschema.databind.io.AbstractDeserializer
applyConfiguration, deserializeToNodeItem, disableFeature, enableFeature, getConstraintValidationHandler, set, setConstraintValidationHandler
-
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.IDeserializer
deserialize, deserialize, deserialize, deserialize, deserialize, deserializeToNodeItem, isValidating
-
-
-
-
Constructor Detail
-
DefaultXmlDeserializer
public DefaultXmlDeserializer(@NonNull IAssemblyClassBinding classBinding)
Construct a new Module binding-based deserializer that reads XML-based Module content.- Parameters:
classBinding
- the assembly class binding describing the Java objects this deserializer parses data into
-
-
Method Detail
-
setXMLInputFactory
protected void setXMLInputFactory(@NonNull org.codehaus.stax2.XMLInputFactory2 factory)
Provide a XML input factory instance that will be used to create XML parser instances.- Parameters:
factory
- the factory instance
-
deserializeToNodeItemInternal
protected final IDocumentNodeItem deserializeToNodeItemInternal(Reader reader, URI documentUri) throws IOException
Description copied from class:AbstractDeserializer
This abstract method delegates parsing to the concrete implementation.- Specified by:
deserializeToNodeItemInternal
in classAbstractDeserializer<CLASS>
- Parameters:
reader
- the reader instance to read data fromdocumentUri
- the URI of the document that is being read- Returns:
- a new node item containing the read contents
- Throws:
IOException
- if an error occurred while reading data from the stream
-
deserializeToValue
public final CLASS deserializeToValue(Reader reader, URI documentUri) throws IOException
Description copied from interface:IDeserializer
Read data from theReader
into a node item instance.- Parameters:
reader
- the reader to read fromdocumentUri
- the URI of the document to read from- Returns:
- a new node item
- Throws:
IOException
- if an error occurred while reading data from the stream
-
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
-
configurationChanged
protected void configurationChanged(@NonNull IMutableConfiguration<T> config)
-
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<?>>
-
-