|
WebObjects 5.2.3 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.webobjects.webservices.support.xml.WOEnterpriseObjectSerializationStrategy
Nested Class Summary |
Nested classes inherited from class com.webobjects.webservices.support.xml.WOSoapConstants |
WOSoapConstants.WOXMLAttributes |
Field Summary | |
static String |
AnyServiceNameIdentifier
|
static String |
ContextPropertyName
The string constant used within an org.apache.axis.MessageContext |
Fields inherited from interface com.webobjects.webservices.support.xml.WOSoapConstants |
EOENTERPRISEOBJECT_QNAME, EOGLOBALID_QNAME, NSKVCNULL_QNAME, NSRANGE_QNAME, NSTIMESTAMP_QNAME, NSTIMEZONE_QNAME, SOAP_ENC_PREFIX, SOAP_URI, WOSOAP_URI, WOSTRINGKEYMAP_QNAME, XSD_URI, XSI_TYPE, XSI_URI |
Constructor Summary | |
WOEnterpriseObjectSerializationStrategy()
|
Method Summary | |
Class |
classForKeyPath(EOEnterpriseObject eo,
String keyPath)
The default implementation simply returns the Class associated with the final component of the keyPath 's EOClassDescription's classForAttributeKey()
result. |
EOEditingContext |
editingContextForDeserialization(String entityName,
EOGlobalID gid)
The default implementation returns EOEditingContext.substitutionEditingContext()
If that is null it creates a new one and sets it as the substitution editing context. |
Object |
elementAttributesForKeyPath(EOEnterpriseObject eo,
String keyPath)
The default implementation returns null which indicates that
the SOAP-XML engine should fill in its own defaults for the element attributes. |
String |
elementNameForKeyPath(EOEnterpriseObject eo,
String keyPath)
The default implementation just returns the keyPath argument. |
Object |
instantiateSubject(String entityName,
EOGlobalID gid,
EOEditingContext ec)
Invoked during deserialization to create the target object. |
NSArray |
keyPathsForSerialization(EOEnterpriseObject eo)
The default implementation returns all the attribute class properties sorted alphabetically and none of the EO's relationships. |
EOEnterpriseObject |
promoteGlobalIDToObject(String entityName,
EOGlobalID gid,
EOEditingContext ec,
boolean shouldAttemptFetch)
A utility method to attempt several different ways to promote a EOGlobalID into an EOEnterpriseObject. |
Object |
proxyForKeyPath(EOEnterpriseObject eo,
String keyPath)
The default implementation simply returns eo.valueForKeyPath(keyPath) but a replacement for this can be substituted as the XML element value. |
boolean |
serializeAsCompleteEOEnterpriseObject()
Invoked during serialization. |
void |
setPropertyForKeyPath(Object eo,
String keyPath,
Object value)
This method is invoked during the deserialization process after parsing the SOAP-XML message. |
static void |
setStrategyForService(WOEnterpriseObjectSerializationStrategy rules,
String serviceName,
String operationName)
A convenience method which gets the current org.apache.axis.MessageContext for the
serialization/deserializtion operation in this thread, and sets the
WOEnterpriseObjectSerializationStrategy.ContextPropertyName to rules |
static WOEnterpriseObjectSerializationStrategy |
strategyForMessageContext(org.apache.axis.MessageContext msgContext)
|
String |
translatedKeyPath(Object eo,
String keyPath)
Returns the key path to supply to key-value coding methods when setting or getting the value at keyPath of
eo . |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final String AnyServiceNameIdentifier
public static final String ContextPropertyName
org.apache.axis.MessageContext
Constructor Detail |
public WOEnterpriseObjectSerializationStrategy()
Method Detail |
public Class classForKeyPath(EOEnterpriseObject eo, String keyPath)
keyPath
's EOClassDescription's classForAttributeKey()
result.
A replacement for this can be substituted to change how the object at key path
keyPath
will be serialized. This is typically done to replace an
object with a pretty printed or formatted value.
eo
- the enterprise object about to be serializedkeyPath
- the key path about to be serialized
keyPath
to serializeproxyForKeyPath(com.webobjects.eocontrol.EOEnterpriseObject, java.lang.String)
,
EOClassDescription.classDescriptionForKeyPath(java.lang.String)
,
EOClassDescription.classForAttributeKey(java.lang.String)
public EOEditingContext editingContextForDeserialization(String entityName, EOGlobalID gid)
EOEditingContext.substitutionEditingContext()
If that is null
it creates a new one and sets it as the substitution editing context.
entityName
- the entity name for the eo about to be deserializedgid
- the globalID for the eo about to be deserialized
EOEditingContext.substitutionEditingContext()
public Object elementAttributesForKeyPath(EOEnterpriseObject eo, String keyPath)
null
which indicates that
the SOAP-XML engine should fill in its own defaults for the element attributes.
The return value must be assignment compatible with org.xml.sax.Attributes
eo
- the enterprise object about to be serializedkeyPath
- the key path about to be serialized
null
or an object which can be type cast to org.xml.sax.Attributes
public String elementNameForKeyPath(EOEnterpriseObject eo, String keyPath)
keyPath
argument.
It provides an opportunity to map the internal KeyValueCoding path to a public
name for the XML.
This method is essentially the inverse of translatedKeyPath
eo
- the enterprise object about to be serializedkeyPath
- the key path about to be serialized
translatedKeyPath(java.lang.Object, java.lang.String)
public Object instantiateSubject(String entityName, EOGlobalID gid, EOEditingContext ec)
gid
already in the editing context
parameter. If none exists, it attempts to fetch an object matching that gid
.
If the fetch fails, it creates and inserts a new EO of entityName
.
If nothing else is successful, it returns a WOStringKeyMap to hold the deserialized properties.
entityName
- the entity name for the eo about to be deserializedgid
- the globalID for the eo about to be deserializedec
- the EOEditingContext to place the deserialized EO within.
public NSArray keyPathsForSerialization(EOEnterpriseObject eo)
eo
- the enterprise object about to be serialized
public EOEnterpriseObject promoteGlobalIDToObject(String entityName, EOGlobalID gid, EOEditingContext ec, boolean shouldAttemptFetch)
gid
already in the editing context
parameter. If none exists, it attempts to fetch an object matching that gid
.
If the fetch fails, it creates and inserts a new EO of entityName
.
If nothing else is successful, it returns null
.
entityName
- the entity name for the eo about to be deserializedgid
- the globalID for the eo about to be deserializedec
- the EOEditingContext to place the deserialized EO within.shouldAttemptFetch
- whether or not a fetch should be attempted at all.
public Object proxyForKeyPath(EOEnterpriseObject eo, String keyPath)
classForKeyPath
eo
- the enterprise object about to be serializedkeyPath
- the key path about to be serialized
classForKeyPath(com.webobjects.eocontrol.EOEnterpriseObject, java.lang.String)
,
NSKeyValueCodingAdditions.valueForKeyPath(java.lang.String)
public boolean serializeAsCompleteEOEnterpriseObject()
true
the xsi type will represent an EOEnterpriseObject, and the generate XML will
be sufficient to deserialize the result as an EO. If false
the xsi type will represent a raw SOAP struct, and
the gid and entity will be omitted.
true
if the XML should be for an EOEnterpriseObject, or false
if it should serialize as a raw SOAP Structpublic void setPropertyForKeyPath(Object eo, String keyPath, Object value)
takeValueForKeyPath()
eo
- the enterprise object which was deserializedkeyPath
- the keyPath to the propertyvalue
- the deserialized value for the propertyNSKeyValueCodingAdditions.takeValueForKeyPath(java.lang.Object, java.lang.String)
public static void setStrategyForService(WOEnterpriseObjectSerializationStrategy rules, String serviceName, String operationName)
org.apache.axis.MessageContext
for the
serialization/deserializtion operation in this thread, and sets the
WOEnterpriseObjectSerializationStrategy.ContextPropertyName
to rules
rules
- An instance of this class.serviceName
- the webservices service name associated with the rules
operationName
- the webservices operation name. May be null
ContextPropertyName
public static WOEnterpriseObjectSerializationStrategy strategyForMessageContext(org.apache.axis.MessageContext msgContext)
public String translatedKeyPath(Object eo, String keyPath)
keyPath
of
eo
. This method is essentially the inverse of
elementNameForKeyPath
.
The XML element name of each of a serialized EO's
property can be different from the key path used to access
that property. In order to perform Key-Value-Coding operations
for some public key path, represented by keyPath
,
a "translated" key path that represents path of an EOProperty
must be available.
eo
- the enterprise object that is being deserializedkeyPath
- the key path that is being deserialized
eo
elementNameForKeyPath(com.webobjects.eocontrol.EOEnterpriseObject, java.lang.String)
|
Last updated Thu Oct 21 15:04:16 PDT 2004. | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |