Humboldt Alignment Editor 2.5.0

eu.esdihumboldt.hale.common.instance.orient.internal
Class OSerializationHelper

java.lang.Object
  extended by eu.esdihumboldt.hale.common.instance.orient.internal.OSerializationHelper

public abstract class OSerializationHelper
extends Object

Serialization helper for storing values not support by OrientDB. Serializes geometries as WKB and holds a runtime cache for CRSs.

Author:
Simon Templer

Nested Class Summary
static class OSerializationHelper.ConvertProxy
          Store information on how to convert a value back to its original form.
 
Field Summary
static String BINARY_WRAPPER_CLASSNAME
          Binary wrapper class name
static String BINARY_WRAPPER_FIELD
          Binary wrapper class field name
static String FIELD_COLLECTION_TYPE
          Field holding the collection type
static String FIELD_CONVERT_ID
          Field specifying the converter ID
static String FIELD_CRS_ID
          Field specifying the CRS ID
static String FIELD_SERIALIZATION_TYPE
          Field specifying the serialization type
static String FIELD_STRING_VALUE
          Field specifying the string value
static String FIELD_VALUES
          Field holding the values of a collection
 
Constructor Summary
OSerializationHelper()
           
 
Method Summary
static Object convertForDB(Object value)
          Prepare a value not supported as field in OrientDB so it can be stored in the database.
static Object convertFromDB(Object value, OGroup parent, QName childName)
          Convert a value received from the database, e.g.
static Object deserialize(com.orientechnologies.orient.core.record.impl.ODocument doc, OGroup parent, QName childName)
          Deserialize a serialized value wrapped in the given document.
static com.orientechnologies.orient.core.record.impl.ODocument serialize(Object value)
          Serialize and/or wrap a value not supported as field in OrientDB so it can be stored in the database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BINARY_WRAPPER_CLASSNAME

public static final String BINARY_WRAPPER_CLASSNAME
Binary wrapper class name

See Also:
Constant Field Values

BINARY_WRAPPER_FIELD

public static final String BINARY_WRAPPER_FIELD
Binary wrapper class field name

See Also:
Constant Field Values

FIELD_SERIALIZATION_TYPE

public static final String FIELD_SERIALIZATION_TYPE
Field specifying the serialization type

See Also:
Constant Field Values

FIELD_CRS_ID

public static final String FIELD_CRS_ID
Field specifying the CRS ID

See Also:
Constant Field Values

FIELD_CONVERT_ID

public static final String FIELD_CONVERT_ID
Field specifying the converter ID

See Also:
Constant Field Values

FIELD_STRING_VALUE

public static final String FIELD_STRING_VALUE
Field specifying the string value

See Also:
Constant Field Values

FIELD_COLLECTION_TYPE

public static final String FIELD_COLLECTION_TYPE
Field holding the collection type

See Also:
Constant Field Values

FIELD_VALUES

public static final String FIELD_VALUES
Field holding the values of a collection

See Also:
Constant Field Values
Constructor Detail

OSerializationHelper

public OSerializationHelper()
Method Detail

convertForDB

public static Object convertForDB(Object value)
Prepare a value not supported as field in OrientDB so it can be stored in the database.

Parameters:
value - the value to convert
Returns:
the converted value that may be used as a property value

serialize

public static com.orientechnologies.orient.core.record.impl.ODocument serialize(Object value)
Serialize and/or wrap a value not supported as field in OrientDB so it can be stored in the database.

Parameters:
value - the value to serialize
Returns:
the document wrapping the value

convertFromDB

public static Object convertFromDB(Object value,
                                   OGroup parent,
                                   QName childName)
Convert a value received from the database, e.g. ODocuments to Instances, Groups or unwraps contained values.

Parameters:
value - the value
parent - the parent group
childName - the name of the child the value is associated to
Returns:
the converted object

deserialize

public static Object deserialize(com.orientechnologies.orient.core.record.impl.ODocument doc,
                                 OGroup parent,
                                 QName childName)
Deserialize a serialized value wrapped in the given document.

Parameters:
doc - the document
parent - the parent group
childName - the name of the child the value is associated to
Returns:
the deserialized value

Humboldt Alignment Editor 2.5.0

Build 2012-12-03_12-30-59
Revision 9d2dd4b0318cda9f1393b1ddd390f7f792d70a2d