Interface IDeserializer<CLASS extends IBoundObject>
- Type Parameters:
CLASS
- the Java type into which data can be read
- All Superinterfaces:
IConfiguration<DeserializationFeature<?>>
,IMutableConfiguration<DeserializationFeature<?>>
- All Known Implementing Classes:
AbstractDeserializer
,DefaultJsonDeserializer
,DefaultXmlDeserializer
,DefaultYamlDeserializer
public interface IDeserializer<CLASS extends IBoundObject>
extends IMutableConfiguration<DeserializationFeature<?>>
Implementations of this interface are able to read structured data into a
bound object instance of the parameterized type.
-
Method Summary
Modifier and TypeMethodDescriptiondefault CLASS
deserialize
(File file) Read data from theFile
into a bound class instance.default CLASS
deserialize
(InputStream is, URI documentUri) Read data from theInputStream
into a bound class instance.default CLASS
deserialize
(Reader reader, URI documentUri) Read data from theReader
into a bound class instance.default CLASS
deserialize
(URL url) Read data from the remote resource into a bound class instance.default CLASS
deserialize
(Path path) Read data from thePath
into a bound class instance.default INodeItem
deserializeToNodeItem
(InputStream is, URI documentUri) Read data from theReader
into a node item instance.deserializeToNodeItem
(Reader reader, URI documentUri) Read data from theReader
into a node item instance.deserializeToValue
(Reader reader, URI documentUri) Read data from theReader
into a node item instance.disableFeature
(DeserializationFeature<?> feature) enableFeature
(DeserializationFeature<?> feature) Get the constraint validation handler configured for this deserializer, which will be used to validate loaded data.default boolean
Determine if the serializer is performing validation.set
(DeserializationFeature<?> feature, Object value) void
Set the constraint violation handler for constraint validation.Methods inherited from interface gov.nist.secauto.metaschema.core.configuration.IConfiguration
get, getFeatureValues, isFeatureEnabled
-
Method Details
-
enableFeature
- Specified by:
enableFeature
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
-
disableFeature
- Specified by:
disableFeature
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
-
applyConfiguration
- Specified by:
applyConfiguration
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
-
set
- Specified by:
set
in interfaceIMutableConfiguration<CLASS extends IBoundObject>
-
isValidating
Determine if the serializer is performing validation.- Returns:
true
if the serializer is performing content validation, orfalse
otherwise
-
getConstraintValidationHandler
Get the constraint validation handler configured for this deserializer, which will be used to validate loaded data.- Returns:
- the validation handler
-
setConstraintValidationHandler
Set the constraint violation handler for constraint validation.- Parameters:
handler
- the handler to use
-
deserialize
@NonNull default CLASS deserialize(@NonNull InputStream is, @NonNull URI documentUri) throws IOException Read data from theInputStream
into a bound class instance.- Parameters:
is
- the input stream to read fromdocumentUri
- the URI of the document to read from- Returns:
- the instance data
- Throws:
IOException
- if an error occurred while reading data from the stream
-
deserialize
Read data from thePath
into a bound class instance.- Parameters:
path
- the file to read from- Returns:
- the instance data
- Throws:
IOException
- if an error occurred while writing data to the file indicated by thepath
parameter
-
deserialize
Read data from theFile
into a bound class instance.- Parameters:
file
- the file to read from- Returns:
- the instance data
- Throws:
IOException
- if an error occurred while reading data from the stream
-
deserialize
Read data from the remote resource into a bound class instance.- Parameters:
url
- the remote resource to read from- Returns:
- the instance data
- Throws:
IOException
- if an error occurred while reading data from the streamURISyntaxException
- if the provided URL is not formatted strictly according to to RFC2396 and cannot be converted to a URI.
-
deserialize
@NonNull default CLASS deserialize(@NonNull Reader reader, @NonNull URI documentUri) throws IOException Read data from theReader
into a bound class instance.- Parameters:
reader
- the reader to read fromdocumentUri
- the URI of the document to read from- Returns:
- the instance data
- Throws:
IOException
- if an error occurred while reading data from the stream
-
deserializeToNodeItem
@NonNull default INodeItem deserializeToNodeItem(@NonNull InputStream is, @NonNull URI documentUri) throws IOException Read data from theReader
into a node item instance.- Parameters:
is
- the input stream 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
-
deserializeToNodeItem
@NonNull INodeItem deserializeToNodeItem(@NonNull Reader reader, @NonNull URI documentUri) throws IOException 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
-
deserializeToValue
@NonNull CLASS deserializeToValue(@NonNull Reader reader, @NonNull URI documentUri) throws IOException 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
-