EOEnterpriseObjectSerializer Class Reference

Inherits org::jabsorb::serializer::AbstractSerializer.

Collaboration diagram for EOEnterpriseObjectSerializer:

Collaboration graph
[legend]

List of all members.

Classes

interface  EOEditingContextFactory
class  ERXECEditingContextFactory
class  SadEditingContextFactory

Public Member Functions

void addAttributes (SerializerState state, EOEnterpriseObject source, JSONObject destination) throws MarshallException
boolean canSerialize (Class clazz, Class jsonClazz)
 EOEnterpriseObjectSerializer ()
Class[] getJSONClasses ()
Class[] getSerializableClasses ()
Object marshall (SerializerState state, Object p, Object o) throws MarshallException
ObjectMatch tryUnmarshall (SerializerState state, Class clazz, Object jso)
Object unmarshall (SerializerState state, Class clazz, Object o) throws UnmarshallException

Static Public Member Functions

static Map< EOEditingContext,
String
contexts ()
static EOEditingContext editingContextForKey (String key)
static NSArray< StringincludedRelationshipNames (EOEnterpriseObject source)
static NSArray< StringreadableAttributeNames (EOEnterpriseObject source)
static String registerEditingContext (EOEditingContext ec)
static NSArray< StringwritableAttributeNames (EOEnterpriseObject source)

Protected Member Functions

void _addCustomAttributes (SerializerState state, EOEnterpriseObject source, JSONObject destination) throws MarshallException
boolean _canInsert (String entityName)
boolean _canSerialize (Class clazz, Class jsonClazz)
NSArray< String_includedRelationshipNames (EOEnterpriseObject eo)
NSArray< String_readableAttributeNames (EOEnterpriseObject eo)
NSArray< String_writableAttributeNames (EOEnterpriseObject eo)

Static Protected Attributes

static final
NSMutableDictionary< String,
NSArray< String > > 
includedRelationshipNames = new NSMutableDictionary<String, NSArray<String>>()
static final
NSMutableDictionary< String,
NSArray< String > > 
readableAttributeNames = new NSMutableDictionary<String, NSArray<String>>()
static final
NSMutableDictionary< String,
NSArray< String > > 
writableAttributeNames = new NSMutableDictionary<String, NSArray<String>>()

Private Attributes

EOEditingContextFactory _editingContextFactory

Static Private Attributes

static Map< EOEditingContext,
String
_contexts = new WeakHashMap<EOEditingContext, String>()
static Class[] _JSONClasses = new Class[] { JSONObject.class }
static Class[] _serializableClasses = new Class[] { EOEnterpriseObject.class }


Constructor & Destructor Documentation


Member Function Documentation

void _addCustomAttributes ( SerializerState  state,
EOEnterpriseObject  source,
JSONObject  destination 
) throws MarshallException [protected]

boolean _canInsert ( String  entityName  )  [protected]

Override to return whether or not a new entity can be inserted.

Parameters:
entityName 

boolean _canSerialize ( Class  clazz,
Class  jsonClazz 
) [protected]

NSArray<String> _includedRelationshipNames ( EOEnterpriseObject  eo  )  [protected]

Override to return the appropriate relationship names.

Parameters:
eo 

NSArray<String> _readableAttributeNames ( EOEnterpriseObject  eo  )  [protected]

Override to return the appropriate attribute names.

Parameters:
eo 

NSArray<String> _writableAttributeNames ( EOEnterpriseObject  eo  )  [protected]

Override to return the appropriate attribute names.

Parameters:
eo 

void addAttributes ( SerializerState  state,
EOEnterpriseObject  source,
JSONObject  destination 
) throws MarshallException

This copies the attributes from the source EOEnterpriseObject to the destination. Only attributes which are class properties are copied. However if an attribute is a class property and also used in a relationship it is assumed to be an exposed primary or foreign key and not copied. Such attributes are set to null. See exposedKeyAttributeNames for details on how this is determined. It can be used when creating custom implementations of the duplicate() method in EOCopyable.

Parameters:
source the EOEnterpriseObject to copy attribute values from
destination the EOEnterpriseObject to copy attribute values to

boolean canSerialize ( Class  clazz,
Class  jsonClazz 
)

static Map<EOEditingContext, String> contexts (  )  [static]

static EOEditingContext editingContextForKey ( String  key  )  [static]

Class [] getJSONClasses (  ) 

Class [] getSerializableClasses (  ) 

static NSArray<String> includedRelationshipNames ( EOEnterpriseObject  source  )  [static]

Returns an array of relationships on this EO that should be included in its marshalled output as the actual destination objects rather than just faults.

Parameters:
source the EOEnterpriseObject being marhsalled
Returns:
an array of relationships that should be included in the marshalling

Object marshall ( SerializerState  state,
Object  p,
Object  o 
) throws MarshallException

static NSArray<String> readableAttributeNames ( EOEnterpriseObject  source  )  [static]

Returns an array of attribute names from the EOEntity of source that should be marshalled to the client.

Parameters:
source the EOEnterpriseObject to copy attribute values from
Returns:
an array of attribute names from the EOEntity of source that should be marshalled

static String registerEditingContext ( EOEditingContext  ec  )  [static]

ObjectMatch tryUnmarshall ( SerializerState  state,
Class  clazz,
Object  jso 
)

Object unmarshall ( SerializerState  state,
Class  clazz,
Object  o 
) throws UnmarshallException

static NSArray<String> writableAttributeNames ( EOEnterpriseObject  source  )  [static]

Returns an array of attribute names from the EOEntity of source that should be marshalled from the client.

Parameters:
source the EOEnterpriseObject
Returns:
an array of attribute names from the EOEntity of source that should be unmarshalled


Member Data Documentation

Map<EOEditingContext, String> _contexts = new WeakHashMap<EOEditingContext, String>() [static, private]

Class [] _JSONClasses = new Class[] { JSONObject.class } [static, private]

Class [] _serializableClasses = new Class[] { EOEnterpriseObject.class } [static, private]

final NSMutableDictionary<String, NSArray<String> > includedRelationshipNames = new NSMutableDictionary<String, NSArray<String>>() [static, protected]

final NSMutableDictionary<String, NSArray<String> > readableAttributeNames = new NSMutableDictionary<String, NSArray<String>>() [static, protected]

final NSMutableDictionary<String, NSArray<String> > writableAttributeNames = new NSMutableDictionary<String, NSArray<String>>() [static, protected]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:42:41 2012 for Project Wonder by  doxygen 1.5.8