Purpose: The serialized object converter can be used to store an arbitrary object or set of objects into a database binary or character field. By default it uses the Java serializer so the target must be serializable. A custom Serializer can also be specified, such as XML or JSON.
Serializer, XMLSerializer, JSONSerializer
| Modifier and Type | Field and Description |
|---|---|
| protected DatabaseMapping | |
| protected Serializer | |
| protected String | |
| protected String |
| Access | Constructor and Description |
|---|---|
| public | |
| public | |
| public | SerializedObjectConverter(DatabaseMapping mapping, Serializer serializer)
PUBLIC: Default constructor. |
| public | SerializedObjectConverter(DatabaseMapping mapping, String serializerClassName)
PUBLIC: Default constructor. |
| Modifier and Type | Method and Description |
|---|---|
| public void | convertClassNamesToClasses(ClassLoader classLoader)
Implements org. |
| public Object | convertDataValueToObjectValue(Object fieldValue, Session session)
Implements org. |
| public Object | convertObjectValueToDataValue(Object attributeValue, Session session)
Implements org. |
| protected DatabaseMapping | |
| public Serializer | |
| public String | |
| public String | |
| public void | initialize(DatabaseMapping mapping, Session session)
Implements org. |
| public boolean | isMutable()
Implements org. |
| public void | |
| public void | |
| public void | setSerializerPackage(String serializerPackage)
Set the package used for XML and JSON serialization JAXBContext. |
| mapping | back to summary |
|---|---|
| protected DatabaseMapping mapping | |
| serializer | back to summary |
|---|---|
| protected Serializer serializer | |
| serializerClassName | back to summary |
|---|---|
| protected String serializerClassName | |
| serializerPackage | back to summary |
|---|---|
| protected String serializerPackage | |
| SerializedObjectConverter | back to summary |
|---|---|
| public SerializedObjectConverter() PUBLIC: Default constructor. | |
| SerializedObjectConverter | back to summary |
|---|---|
| public SerializedObjectConverter(DatabaseMapping mapping) PUBLIC: Default constructor. | |
| SerializedObjectConverter | back to summary |
|---|---|
| public SerializedObjectConverter(DatabaseMapping mapping, Serializer serializer) PUBLIC: Default constructor. | |
| SerializedObjectConverter | back to summary |
|---|---|
| public SerializedObjectConverter(DatabaseMapping mapping, String serializerClassName) PUBLIC: Default constructor. | |
| convertClassNamesToClasses | back to summary |
|---|---|
| public void convertClassNamesToClasses(ClassLoader classLoader) Implements org. INTERNAL: Convert all the class-name-based settings in this converter to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes. This method is implemented by subclasses as necessary.
| |
| convertDataValueToObjectValue | back to summary |
|---|---|
| public Object convertDataValueToObjectValue(Object fieldValue, Session session) throws DescriptorException Implements org. INTERNAL: The fieldValue will be a byte array. Create a ByteArrayInputStream on the fieldValue. Create an ObjectInputStream on the ByteArrayInputStream to read in the objects.
| |
| convertObjectValueToDataValue | back to summary |
|---|---|
| public Object convertObjectValueToDataValue(Object attributeValue, Session session) Implements org. INTERNAL: Convert the object to a byte array through serialize.
| |
| getMapping | back to summary |
|---|---|
| protected DatabaseMapping getMapping() INTERNAL: Return the mapping. | |
| getSerializer | back to summary |
|---|---|
| public Serializer getSerializer() Return the serialize used for this converter. | |
| getSerializerClassName | back to summary |
|---|---|
| public String getSerializerClassName() Return the class name of the serializer. | |
| getSerializerPackage | back to summary |
|---|---|
| public String getSerializerPackage() Return the package used for XML and JSON serialization JAXBContext. | |
| initialize | back to summary |
|---|---|
| public void initialize(DatabaseMapping mapping, Session session) Implements org. INTERNAL: Set the mapping.
| |
| isMutable | back to summary |
|---|---|
| public boolean isMutable() Implements org. INTERNAL: If the converter converts the value to a non-atomic value, i.e. a value that can have its' parts changed without being replaced, then it must return false, serialization can be non-atomic.
| |
| setSerializer | back to summary |
|---|---|
| public void setSerializer(Serializer serializer) Set the serialize used for this converter. | |
| setSerializerClassName | back to summary |
|---|---|
| public void setSerializerClassName(String serializerClassName) Set the class name of the serializer. | |
| setSerializerPackage | back to summary |
|---|---|
| public void setSerializerPackage(String serializerPackage) Set the package used for XML and JSON serialization JAXBContext. | |