|
WebObjects 5.4.2 | ||||||||
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 com.webobjects.webservices.generation.WORuleSerializationStrategy
public class WORuleSerializationStrategy
The WORuleSerializationStrategy implements WOEnterpriseObjectSerializationStrategy methods by using information from a D2WContext. When an operation invocation gets to the JavaWebServicesGeneration framework, a WOOperation is created and is given a chance to supply its own WOEnterpriseObjectSerializationStrategy strategy. If the WOOperation returns null (the default) for its strategy, a WORuleSerializationStrategy is created with a D2WContext that contains rule based information about the operation being invoked and the types and names of the operation's input and output parts. The rule based strategy can override methods from WOEnterpriseObjectSerializationStrategy so that the behaviour is goverened by the rules in the D2WContext's model and the D2WContext's state.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.webobjects.webservices.support.xml.WOSoapConstants |
---|
WOSoapConstants.WOXMLAttributes |
Field Summary |
---|
Fields inherited from class com.webobjects.webservices.support.xml.WOEnterpriseObjectSerializationStrategy |
---|
AnyServiceNameIdentifier, ContextPropertyName |
Fields inherited from interface com.webobjects.webservices.support.xml.WOSoapConstants |
---|
EOENTERPRISEOBJECT_QNAME, EOGLOBALID_QNAME, EOGLOBALID_QNAME_WEBSERVICESCORE_WORKAROUND, NS_PREFIX_WOSOAP_ENC, NSARRAY_QNAME, NSDATA_QNAME, NSDICTIONARY_QNAME, NSKVCNULL_QNAME, NSRANGE_QNAME, NSSET_QNAME, NSTIMESTAMP_QNAME, NSTIMEZONE_QNAME, SOAP_ENC_PREFIX, SOAP_URI, WOSOAP_URI, WOSTRINGKEYMAP_QNAME, XSD_URI, XSI_TYPE, XSI_URI |
Constructor Summary | |
---|---|
WORuleSerializationStrategy()
Default constructor. |
|
WORuleSerializationStrategy(D2WContext context)
Creates a new WORuleSerializationStrategy that uses context
to implement its strategy. |
Method Summary | |
---|---|
Class |
classForKeyPath(EOEnterpriseObject eo,
String keyPath)
Returns the Class associated with the final component of the path, keyPath , of eo . |
D2WContext |
d2wContext()
Returns the D2WContext this object uses to implement its serialization strategy. |
EOEditingContext |
editingContextForDeserialization(String entityName,
EOGlobalID gid)
Returns the current Session's EOEditingContext if the request has a session. |
NSArray |
keyPathsForSerialization(EOEnterpriseObject eo)
Returns an array of output part names that will be added to the serialized content of EOEnterpriseObjects (specifically those EO's whose entity name match the D2WContext value for key WOServiceUtilities.RuleSystemConstants.EntityNameKey ). |
Object |
proxyForKeyPath(EOEnterpriseObject eo,
String keyPath)
Overrides proxyForKeyPath in WOEnterpriseObjectSerializationStrategy
to replace the EO(s) at key path keyPath of EO eo with
the globalID(s) of the EO(s) at keyPath . |
boolean |
serializeAsCompleteEOEnterpriseObject()
Overrides serializeAsCompleteEOEnterpriseObject in WOEnterpriseObjectSerializationStrategy. |
void |
setD2wContext(D2WContext context)
Sets the D2WContext this object uses to implement its serialization strategy. |
void |
setPropertyForKeyPath(Object eo,
String keyPath,
Object value)
This method is invoked during the deserialization process after parsing the SOAP-XML message. |
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 com.webobjects.webservices.support.xml.WOEnterpriseObjectSerializationStrategy |
---|
elementAttributesForKeyPath, elementNameForKeyPath, instantiateSubject, promoteGlobalIDToObject, setStrategyForService, strategyForMessageContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public WORuleSerializationStrategy()
public WORuleSerializationStrategy(D2WContext context)
context
to implement its strategy.
Method Detail |
---|
public void setD2wContext(D2WContext context)
context
- a new D2WContextpublic D2WContext d2wContext()
public NSArray keyPathsForSerialization(EOEnterpriseObject eo)
Returns an array of output part names that will be added to
the serialized content of EOEnterpriseObjects (specifically those EO's whose entity
name match the D2WContext value for key
WOServiceUtilities.RuleSystemConstants.EntityNameKey
).
The output part names returned by this method do not include names that translate to aggregate key paths. Values for aggrregate key paths are returned as a seperate WOStringKeyMap.
keyPathsForSerialization
in class WOEnterpriseObjectSerializationStrategy
eo
- the enterprise object about to be serialized
WOOperation.aggregateValuesResult(com.webobjects.foundation.NSArray)
public String translatedKeyPath(Object eo, String keyPath)
keyPath
of
eo
.
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.
The WORuleSerializationStrategy implementation sets the value of
the key PropertyKeyKey
in its D2WContext to keyPath
and then gets the value for the D2WContext's key,
TranslatedAttributeNameKey
. If result is null, no translation is
needed and the original keyPath
is returned.
translatedKeyPath
in class WOEnterpriseObjectSerializationStrategy
eo
- the enterprise object that is being serialized or deserializedkeyPath
- the key path that is being serialized or deserialized
eo
WOEnterpriseObjectSerializationStrategy.elementNameForKeyPath(com.webobjects.eocontrol.EOEnterpriseObject, java.lang.String)
public Object proxyForKeyPath(EOEnterpriseObject eo, String keyPath)
proxyForKeyPath
in WOEnterpriseObjectSerializationStrategy
to replace the EO(s) at key path keyPath
of EO eo
with
the globalID(s) of the EO(s) at keyPath
. This ensures that only the EO
eo
is serialized as an EOEnterpriseObject and that all destination EOs
are serialized as EOGlobalIDs.
proxyForKeyPath
in class WOEnterpriseObjectSerializationStrategy
eo
- the enterprise object about to be serializedkeyPath
- the key path about to be serialized
eo
WORuleSerializationStrategy.classForKeyPath(com.webobjects.eocontrol.EOEnterpriseObject, java.lang.String)
,
NSKeyValueCodingAdditions.valueForKeyPath(java.lang.String)
public Class classForKeyPath(EOEnterpriseObject eo, String keyPath)
keyPath
, of eo
. The
value for key PropertyKeyKey
is set
in the D2WContext and then the value of the D2WContext key
ClassForPropertyKeyKey
is returned.
classForKeyPath
in class WOEnterpriseObjectSerializationStrategy
eo
- the enterprise object about to be serializedkeyPath
- the key path about to be serialized
keyPath
to serializeWORuleSerializationStrategy.proxyForKeyPath(com.webobjects.eocontrol.EOEnterpriseObject, java.lang.String)
public EOEditingContext editingContextForDeserialization(String entityName, EOGlobalID gid)
editingContextForDeserialization
in class WOEnterpriseObjectSerializationStrategy
entityName
- the entity name for the eo about to be deserializedgid
- the globalID for the eo about to be deserialized
EOEditingContext.substitutionEditingContext()
public void setPropertyForKeyPath(Object eo, String keyPath, Object value)
keyPath
.
setPropertyForKeyPath
in class WOEnterpriseObjectSerializationStrategy
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)
,
WORuleSerializationStrategy.translatedKeyPath(java.lang.Object, java.lang.String)
public boolean serializeAsCompleteEOEnterpriseObject()
false
if the D2WContext value for key ReturnsSOAPStructKey
is true. Returns true otherwise.
serializeAsCompleteEOEnterpriseObject
in class WOEnterpriseObjectSerializationStrategy
true
if the XML should be for an EOEnterpriseObject, or false
if it should serialize as a raw SOAP Struct
|
Last updated June 2008 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |