Project Wonder 5.0

er.ajax.json.serializer
Class EOEnterpriseObjectSerializer

java.lang.Object
  extended by org.jabsorb.serializer.AbstractSerializer
      extended by er.ajax.json.serializer.EOEnterpriseObjectSerializer
All Implemented Interfaces:
java.io.Serializable, org.jabsorb.serializer.Serializer

public class EOEnterpriseObjectSerializer
extends org.jabsorb.serializer.AbstractSerializer

La classe EOEnterpriseObjectSerializer s'occupe de la conversion des objets paramĂȘtres de type EOEnterpriseObject entre le monde Javascript et le monde Java.

See Also:
Serialized Form
Author:
john, Jean-François Veillette
Properties
er.ajax.json.EOEditingContextFactoryer.ajax.json.EOEditingContextFactory
           
er.ajax.json.[entityName].canInserter.ajax.json.[entityName].canInsert
           
er.ajax.json.[currentEntity.name].attributeser.ajax.json.[currentEntity.name].attributes
           
er.ajax.json.[currentEntity.name].writableAttributeser.ajax.json.[currentEntity.name].writableAttributes
           
er.ajax.json.[currentEntity.name]relationshipser.ajax.json.[currentEntity.name]relationships
           

Nested Class Summary
static interface EOEnterpriseObjectSerializer.EOEditingContextFactory
           
static class EOEnterpriseObjectSerializer.ERXECEditingContextFactory
           
static class EOEnterpriseObjectSerializer.SadEditingContextFactory
           
 
Field Summary
protected static com.webobjects.foundation.NSMutableDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> includedRelationshipNames
           
protected static com.webobjects.foundation.NSMutableDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> readableAttributeNames
           
protected static com.webobjects.foundation.NSMutableDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> writableAttributeNames
           
 
Fields inherited from class org.jabsorb.serializer.AbstractSerializer
ser
 
Constructor Summary
EOEnterpriseObjectSerializer()
           
 
Method Summary
protected  void _addCustomAttributes(org.jabsorb.serializer.SerializerState state, com.webobjects.eocontrol.EOEnterpriseObject source, org.json.JSONObject destination)
           
protected  boolean _canInsert(java.lang.String entityName)
          Override to return whether or not a new entity can be inserted.
protected  boolean _canSerialize(java.lang.Class clazz, java.lang.Class jsonClazz)
           
protected  com.webobjects.foundation.NSArray<java.lang.String> _includedRelationshipNames(com.webobjects.eocontrol.EOEnterpriseObject eo)
          Override to return the appropriate relationship names.
protected  com.webobjects.foundation.NSArray<java.lang.String> _readableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject eo)
          Override to return the appropriate attribute names.
protected  com.webobjects.foundation.NSArray<java.lang.String> _writableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject eo)
          Override to return the appropriate attribute names.
 void addAttributes(org.jabsorb.serializer.SerializerState state, com.webobjects.eocontrol.EOEnterpriseObject source, org.json.JSONObject destination)
          This copies the attributes from the source EOEnterpriseObject to the destination.
 boolean canSerialize(java.lang.Class clazz, java.lang.Class jsonClazz)
           
static java.util.Map<com.webobjects.eocontrol.EOEditingContext,java.lang.String> contexts()
           
static com.webobjects.eocontrol.EOEditingContext editingContextForKey(java.lang.String key)
           
 java.lang.Class[] getJSONClasses()
           
 java.lang.Class[] getSerializableClasses()
           
static com.webobjects.foundation.NSArray<java.lang.String> includedRelationshipNames(com.webobjects.eocontrol.EOEnterpriseObject source)
          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.
 java.lang.Object marshall(org.jabsorb.serializer.SerializerState state, java.lang.Object p, java.lang.Object o)
           
static com.webobjects.foundation.NSArray<java.lang.String> readableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject source)
          Returns an array of attribute names from the EOEntity of source that should be marshalled to the client.
static java.lang.String registerEditingContext(com.webobjects.eocontrol.EOEditingContext ec)
           
 org.jabsorb.serializer.ObjectMatch tryUnmarshall(org.jabsorb.serializer.SerializerState state, java.lang.Class clazz, java.lang.Object jso)
           
 java.lang.Object unmarshall(org.jabsorb.serializer.SerializerState state, java.lang.Class clazz, java.lang.Object o)
           
static com.webobjects.foundation.NSArray<java.lang.String> writableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject source)
          Returns an array of attribute names from the EOEntity of source that should be marshalled from the client.
 
Methods inherited from class org.jabsorb.serializer.AbstractSerializer
setOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

readableAttributeNames

protected static final com.webobjects.foundation.NSMutableDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> readableAttributeNames

writableAttributeNames

protected static final com.webobjects.foundation.NSMutableDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> writableAttributeNames

includedRelationshipNames

protected static final com.webobjects.foundation.NSMutableDictionary<java.lang.String,com.webobjects.foundation.NSArray<java.lang.String>> includedRelationshipNames
Constructor Detail

EOEnterpriseObjectSerializer

public EOEnterpriseObjectSerializer()
Method Detail

getSerializableClasses

public java.lang.Class[] getSerializableClasses()

getJSONClasses

public java.lang.Class[] getJSONClasses()

_canSerialize

protected boolean _canSerialize(java.lang.Class clazz,
                                java.lang.Class jsonClazz)

canSerialize

public boolean canSerialize(java.lang.Class clazz,
                            java.lang.Class jsonClazz)
Specified by:
canSerialize in interface org.jabsorb.serializer.Serializer
Overrides:
canSerialize in class org.jabsorb.serializer.AbstractSerializer

tryUnmarshall

public org.jabsorb.serializer.ObjectMatch tryUnmarshall(org.jabsorb.serializer.SerializerState state,
                                                        java.lang.Class clazz,
                                                        java.lang.Object jso)

unmarshall

public java.lang.Object unmarshall(org.jabsorb.serializer.SerializerState state,
                                   java.lang.Class clazz,
                                   java.lang.Object o)
                            throws org.jabsorb.serializer.UnmarshallException
Throws:
org.jabsorb.serializer.UnmarshallException

marshall

public java.lang.Object marshall(org.jabsorb.serializer.SerializerState state,
                                 java.lang.Object p,
                                 java.lang.Object o)
                          throws org.jabsorb.serializer.MarshallException
Throws:
org.jabsorb.serializer.MarshallException

addAttributes

public void addAttributes(org.jabsorb.serializer.SerializerState state,
                          com.webobjects.eocontrol.EOEnterpriseObject source,
                          org.json.JSONObject destination)
                   throws org.jabsorb.serializer.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
Throws:
org.jabsorb.serializer.MarshallException

_addCustomAttributes

protected void _addCustomAttributes(org.jabsorb.serializer.SerializerState state,
                                    com.webobjects.eocontrol.EOEnterpriseObject source,
                                    org.json.JSONObject destination)
                             throws org.jabsorb.serializer.MarshallException
Throws:
org.jabsorb.serializer.MarshallException

_canInsert

protected boolean _canInsert(java.lang.String entityName)
Override to return whether or not a new entity can be inserted.

Parameters:
entityName -

_readableAttributeNames

protected com.webobjects.foundation.NSArray<java.lang.String> _readableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject eo)
Override to return the appropriate attribute names.

Parameters:
eo -

_writableAttributeNames

protected com.webobjects.foundation.NSArray<java.lang.String> _writableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject eo)
Override to return the appropriate attribute names.

Parameters:
eo -

_includedRelationshipNames

protected com.webobjects.foundation.NSArray<java.lang.String> _includedRelationshipNames(com.webobjects.eocontrol.EOEnterpriseObject eo)
Override to return the appropriate relationship names.

Parameters:
eo -

readableAttributeNames

public static com.webobjects.foundation.NSArray<java.lang.String> readableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject source)
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

writableAttributeNames

public static com.webobjects.foundation.NSArray<java.lang.String> writableAttributeNames(com.webobjects.eocontrol.EOEnterpriseObject source)
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

includedRelationshipNames

public static com.webobjects.foundation.NSArray<java.lang.String> includedRelationshipNames(com.webobjects.eocontrol.EOEnterpriseObject source)
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

contexts

public static java.util.Map<com.webobjects.eocontrol.EOEditingContext,java.lang.String> contexts()

registerEditingContext

public static java.lang.String registerEditingContext(com.webobjects.eocontrol.EOEditingContext ec)

editingContextForKey

public static com.webobjects.eocontrol.EOEditingContext editingContextForKey(java.lang.String key)

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.