public interface TextSerializer extends Serializer
Title: Object Mediation Framework
Description: Defines a general interface for XML
and JSON
serializers.
Copyright: Copyright (c) 2015
Company: StreamScape Technologies
Modifier and Type | Method and Description |
---|---|
java.lang.Object |
deserialize(java.lang.Class objectClass,
java.lang.String buffer)
Deserializes instance of Java object from a
buffer . |
java.lang.Object |
deserialize(java.io.Reader reader)
Deserializes instance of Java object from a
Reader . |
java.lang.Object |
deserialize(java.lang.String buffer)
Deserializes instance of a Java object from string.
|
java.lang.Object |
deserialize(java.lang.String semanticType,
java.io.Reader reader)
Deserializes instance of Java object from a
Reader . |
java.lang.Object |
deserialize(java.lang.String semanticType,
java.lang.String buffer)
Deserializes instance of a Java object from string.
|
java.lang.String |
serialize(java.lang.Object obj)
Serializes an instance of an arbitrary
Java Object into string. |
void |
serialize(java.lang.Object obj,
java.io.Writer writer)
Serializes instance of a Java object into
Writer . |
java.lang.String |
serialize(java.lang.String semanticType,
java.lang.Object obj)
Serializes an instance of an arbitrary
Java Object into string. |
void |
serialize(java.lang.String semanticType,
java.lang.Object obj,
java.io.Writer writer)
Serializes instance of a Java object into
Writer . |
deserialize, deserialize, deserialize, deserialize, destroy, getClassLoader, getName, serialize, serialize, setClassLoader
java.lang.String serialize(java.lang.Object obj) throws SerializerException
Java Object
into string. The object may be
a plain Java object or an instance of a StructuredDataObject
.
The object must be defined as a known Semantic Type and all of its elements must be registered
in the Alias Map
.obj
- the object to be serialized.SerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.void serialize(java.lang.Object obj, java.io.Writer writer) throws SerializerException
Writer
. The object may be an
instance of StructuredDataObject
or a standard Java object. The actual output format is
implementation specific. The object must be defined as a known Semantic Type and all of its elements
must be registered in the Alias Map
.obj
- the object to be serialized.writer
- the writer that holds the serialized object.SerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.java.lang.String serialize(java.lang.String semanticType, java.lang.Object obj) throws SerializerException
Java Object
into string. The object may be
a plain Java object or an instance of a StructuredDataObject
.
The object must be defined as a known Semantic Type and all of its elements must be registered
in the Alias Map
.
This method allows for a specific semantic type to be specified, which results in a form of protected casting for
the object based on the Alias Map
. It is therefore possible to serialize varied objects that implement
the same interface.
semanticType
- the semantic type of the specified object.obj
- the object to be serializedSerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.void serialize(java.lang.String semanticType, java.lang.Object obj, java.io.Writer writer) throws SerializerException
Writer
. The object may be an
instance of StructuredDataObject
or a standard Java object. The actual output format is
implementation specific. The object must be defined as a known Semantic Type and all of its elements
must be registered in the Alias Map
.
This method allows for a specific semantic type to be specified, which results in a form of protected casting for
the object based on the Alias Map
. It is therefore possible to serialize varied objects that implement
the same interface.
semanticType
- the semantic type of the specified object.obj
- the object to be serialized.writer
- the writer that holds the serialized object.SerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.java.lang.Object deserialize(java.lang.String semanticType, java.lang.String buffer) throws SerializerException
Alias Map
. The actual instance
creation is implementation specific and may be JVM dependent. Framework serializers may not require the presence of a
null constructor.
The method allows users to specify a particular semantic type, thereby engaging in forced casting of the deserialized object.
semanticType
- the semantic type of the specified object.buffer
- the string containing serialized object.SerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.java.lang.Object deserialize(java.lang.String semanticType, java.io.Reader reader) throws SerializerException
Reader
. The reader is a text representation of an
object in its serialized form. Meaning that the actual format of the object may be XML or JSON or whatever
format dictated by the serializer. The actual format is implementation specific. This method requires that the
supplied Semantic Type and all of its elements must be registered in the Alias Map
. The actual
instance creation is implementation specific and may depend on the specific JVM. Framework serializers may not require
the presence of a null constructor.
The method allows users to specify a particular semantic type, thereby engaging in forced casting of the deserialized object.
semanticType
- the semantic type of the specified object.reader
- the reader containing serialized object.SerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.java.lang.Object deserialize(java.lang.String buffer) throws SerializerException
Alias Map
.
The actual instance creation is implementation specific. Framework serializers may not require the presence of a
null constructor.buffer
- the string containing serialized object.SerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.java.lang.Object deserialize(java.io.Reader reader) throws SerializerException
Reader
. The reader is a text representation of an
object in its serialized form. Meaning that the actual format of the object may be XML or JSON or whatever
format dictated by the serializer. The actual format is implementation specific. This method requires that the
object must be defined as a known Semantic Type and all of its elements must be registered in the Alias Map
.
The actual instance creation is implementation specific and may depend on the specific JVM. Framework serializers may
not require the presence of a null constructor.reader
- the reader containing serialized object.SerializerException
- if an object type or class are not defined in the Alias Map
or
if other errors occur.java.lang.Object deserialize(java.lang.Class objectClass, java.lang.String buffer) throws SerializerException
buffer
. Buffer contains a text representation of an
object in its serialized form. Meaning that the actual format of the object may be XML or JSON or whatever
format dictated by the serializer. The actual format is implementation specific.
The method allows users to specify a particular semantic type, thereby engaging in forced casting of the deserialized object.
objectClass
- the class of the specified object.buffer
- the buffer containing serialized object.SerializerException
- if some errors occur.Copyright © 2015-2024 StreamScape Technologies. All rights reserved.