|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.rest.ERXRestRequestNode
public class ERXRestRequestNode
ERXRestRequestNode provides a model of a REST request. Because the incoming document format can vary (XML, JSON, etc), we needed a document model that is more abstract than just an org.w3c.dom. Or, rather, one that isn't obnoxious to use.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
---|
com.webobjects.foundation.NSKeyValueCodingAdditions.DefaultImplementation, com.webobjects.foundation.NSKeyValueCodingAdditions.Utility |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor |
Field Summary |
---|
Fields inherited from interface com.webobjects.foundation.NSKeyValueCodingAdditions |
---|
_CLASS, _KeyPathSeparatorChar, KeyPathSeparator |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
NullValue |
Constructor Summary | |
---|---|
ERXRestRequestNode(java.lang.String name,
boolean rootNode)
Construct a node with the given name |
|
ERXRestRequestNode(java.lang.String name,
java.lang.Object value,
boolean rootNode)
Construct a node with the given name and value. |
Method Summary | |
---|---|
protected void |
_addAttributeNodeForKeyInObject(ERXKey<?> key,
java.lang.Object obj,
ERXKeyFilter keyFilter)
|
protected void |
_addAttributesAndRelationshipsForObjectOfEntity(java.lang.Object obj,
com.webobjects.eocontrol.EOClassDescription classDescription,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate,
java.util.Set<java.lang.Object> visitedObjects)
|
protected void |
_addToManyRelationshipNodeForKeyOfEntityInObject(ERXKey<?> key,
com.webobjects.eocontrol.EOClassDescription destinationEntity,
java.lang.Object obj,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate,
java.util.Set<java.lang.Object> visitedObjects)
|
protected void |
_addToOneRelationshipNodeForKeyInObject(ERXKey<?> key,
java.lang.Object obj,
com.webobjects.eocontrol.EOClassDescription destinationEntity,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate,
java.util.Set<java.lang.Object> visitedObjects)
|
protected void |
_fillInWithObjectAndFilter(java.lang.Object obj,
com.webobjects.eocontrol.EOClassDescription classDescription,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate,
java.util.Set<java.lang.Object> visitedObjects)
|
protected void |
_safeDidSkipValueForKey(ERXKeyFilter keyFilter,
java.lang.Object target,
java.lang.Object value,
java.lang.String key)
|
protected void |
_safeDidTakeValueForKey(ERXKeyFilter keyFilter,
java.lang.Object target,
java.lang.Object value,
java.lang.String key)
|
protected void |
_safeWillTakeValueForKey(ERXKeyFilter keyFilter,
java.lang.Object target,
java.lang.Object value,
java.lang.String key)
|
void |
addChild(ERXRestRequestNode child)
Adds a child to this node. |
java.lang.Object |
associatedObject()
Returns the original object associated with this node. |
java.lang.Object |
attributeForKey(java.lang.String key)
Returns the attribute value for the given key. |
java.lang.Object |
attributeOrChildNodeValue(java.lang.String name)
Returns the type of this node. |
com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> |
attributes()
Returns the attributes dictionary for this node. |
ERXRestRequestNode |
childNamed(java.lang.String name)
Returns the first child named 'name'. |
com.webobjects.foundation.NSArray<ERXRestRequestNode> |
children()
Returns the children of this node. |
ERXRestRequestNode |
cloneNode()
Clones this node. |
java.lang.Object |
createObjectWithFilter(java.lang.String entityName,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate)
Creates a new instance of an object represented by this request node. |
protected void |
guessNull()
|
java.lang.Object |
id()
Returns the ID associated with this node. |
boolean |
isArray()
Return whether or not this node represents an array or to-many relationship. |
protected boolean |
isClassProperty(com.webobjects.eocontrol.EOClassDescription classDescription,
java.lang.String key)
|
boolean |
isNull()
Returns whether or not this node represents a null value. |
boolean |
isRootNode()
Returns whether or not this is a root node (a root node is one that would typically have a node name that is an entity name -- the actual root, or elements in an array, for instance). |
java.lang.String |
name()
Returns the name of this node. |
java.lang.Object |
objectWithFilter(java.lang.String entityName,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate)
Returns the object that this request node represents. |
java.lang.Object |
removeAttributeForKey(java.lang.String key)
Removes the attribute that has the given name. |
java.lang.Object |
removeAttributeOrChildNodeNamed(java.lang.String name)
Removes the attribute or child node that has the given name (and returns it). |
ERXRestRequestNode |
removeChildNamed(java.lang.String name)
Removes the child name that has the given name. |
static ERXRestRequestNode |
requestNodeWithObjectAndFilter(com.webobjects.eocontrol.EOClassDescription classDescription,
java.util.List<?> objects,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate)
Creates a hierarchy of ERXRestRequestNodes based off of the given array of objects. |
static ERXRestRequestNode |
requestNodeWithObjectAndFilter(java.lang.Object obj,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate)
Creates a hierarchy of ERXRestRequestNodes based off of the given object. |
void |
setArray(boolean array)
Sets whether or not this node represents an array or to-many relationship. |
void |
setAssociatedObject(java.lang.Object associatedObject)
Sets the original object associated with this node. |
void |
setAttributeForKey(java.lang.Object attribute,
java.lang.String key)
Sets the attribute value for the given key. |
void |
setID(java.lang.Object id)
Sets the ID associated with this node. |
void |
setName(java.lang.String name)
Sets the name of this node. |
void |
setNull(boolean isNull)
Sets whether or not this node represents a null value. |
void |
setRootNode(boolean rootNode)
Sets whether or not this is a root node (a root node is one that would typically have a node name that is an entity name -- the actual root, or elements in an array, for instance). |
void |
setType(java.lang.String type)
Sets the type of this node (type as in the Class that it represents). |
void |
setValue(java.lang.Object value)
Sets the value for this node. |
void |
takeValueForKey(java.lang.Object value,
java.lang.String key)
|
void |
takeValueForKeyPath(java.lang.Object value,
java.lang.String keyPath)
|
java.lang.Object |
toJavaCollection(ERXRestFormat.Delegate delegate)
Returns the Java object that corresponds to this node hierarchy. |
java.lang.Object |
toJavaCollection(ERXRestFormat.Delegate delegate,
java.util.Map<java.lang.Object,ERXRestRequestNode> conversionMap)
Returns the Java object that corresponds to this node hierarchy. |
protected java.lang.Object |
toJavaCollection(ERXRestFormat.Delegate delegate,
java.util.Map<java.lang.Object,ERXRestRequestNode> conversionMap,
java.util.Map<java.lang.Object,java.lang.Object> associatedObjects)
Returns the Java object that corresponds to this node hierarchy. |
java.lang.Object |
toNSCollection(ERXRestFormat.Delegate delegate)
Returns the NSCollection/Java object that corresponds to this node hierarchy. |
protected java.lang.Object |
toNSCollection(ERXRestFormat.Delegate delegate,
com.webobjects.foundation.NSMutableDictionary<java.lang.Object,java.lang.Object> associatedObjects)
Returns the NSCollection/Java object that corresponds to this node hierarchy. |
java.lang.String |
toString()
|
java.lang.String |
toString(ERXRestFormat format)
Returns a string representation of this request node using the given format. |
java.lang.String |
toString(IERXRestWriter writer,
ERXRestFormat.Delegate delegate)
Returns a string representation of this request node using the given IERXRestWriter. |
protected void |
toString(java.lang.StringBuffer sb,
int depth)
|
java.lang.String |
type()
Returns the type of this node (type as in the Class that it represents). |
void |
updateObjectWithFilter(java.lang.Object obj,
ERXKeyFilter keyFilter,
IERXRestDelegate delegate)
Updates the given object based on this request node. |
java.lang.Object |
value()
Returns the value for this node (or null if it doesn't exist). |
java.lang.Object |
valueForKey(java.lang.String key)
|
java.lang.Object |
valueForKeyPath(java.lang.String keyPath)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ERXRestRequestNode(java.lang.String name, boolean rootNode)
name
- the name of this noderootNode
- if true, the node is the root of a graphpublic ERXRestRequestNode(java.lang.String name, java.lang.Object value, boolean rootNode)
name
- the name of this noderootNode
- if true, the node is the root of a graphvalue
- the value of this nodeMethod Detail |
---|
public ERXRestRequestNode cloneNode()
public void setRootNode(boolean rootNode)
rootNode
- whether or not this is a root nodepublic boolean isRootNode()
public java.lang.Object toJavaCollection(ERXRestFormat.Delegate delegate)
delegate
- the format delegate to notify during rendering
public java.lang.Object toJavaCollection(ERXRestFormat.Delegate delegate, java.util.Map<java.lang.Object,ERXRestRequestNode> conversionMap)
delegate
- the format delegate to notify during renderingconversionMap
- the conversion map to use to record object => request node mappings
protected java.lang.Object toJavaCollection(ERXRestFormat.Delegate delegate, java.util.Map<java.lang.Object,ERXRestRequestNode> conversionMap, java.util.Map<java.lang.Object,java.lang.Object> associatedObjects)
delegate
- the format delegate to notify during renderingconversionMap
- the conversion map to use to record object => request node mappingsassociatedObjects
- the associatedObjects map (to prevent infinite loops)
public java.lang.Object toNSCollection(ERXRestFormat.Delegate delegate)
protected java.lang.Object toNSCollection(ERXRestFormat.Delegate delegate, com.webobjects.foundation.NSMutableDictionary<java.lang.Object,java.lang.Object> associatedObjects)
associatedObjects
- the associatedObjects map (to prevent infinite loops)
public void setArray(boolean array)
array
- whether or not this node represents an array or to-many relationshippublic boolean isArray()
public void setAssociatedObject(java.lang.Object associatedObject)
associatedObject
- the original object associated with this nodepublic java.lang.Object associatedObject()
public void takeValueForKey(java.lang.Object value, java.lang.String key)
takeValueForKey
in interface com.webobjects.foundation.NSKeyValueCoding
public java.lang.Object valueForKey(java.lang.String key)
valueForKey
in interface com.webobjects.foundation.NSKeyValueCoding
public java.lang.Object valueForKeyPath(java.lang.String keyPath)
valueForKeyPath
in interface com.webobjects.foundation.NSKeyValueCodingAdditions
public void takeValueForKeyPath(java.lang.Object value, java.lang.String keyPath)
takeValueForKeyPath
in interface com.webobjects.foundation.NSKeyValueCodingAdditions
public ERXRestRequestNode childNamed(java.lang.String name)
name
- the name to look for
public ERXRestRequestNode removeChildNamed(java.lang.String name)
name
- the name of the node to remove
public void setType(java.lang.String type)
type
- the type of this nodepublic java.lang.String type()
public void setID(java.lang.Object id)
id
- the ID associated with this nodepublic java.lang.Object id()
public java.lang.Object removeAttributeOrChildNodeNamed(java.lang.String name)
name
- the name of the attribute or node to remove
public java.lang.Object attributeOrChildNodeValue(java.lang.String name)
protected void guessNull()
public void setNull(boolean isNull)
isNull
- whether or not this node represents a null valuepublic boolean isNull()
public java.lang.String name()
public void setName(java.lang.String name)
name
- the name of this nodepublic java.lang.Object value()
public void setValue(java.lang.Object value)
value
- the value for this nodepublic void setAttributeForKey(java.lang.Object attribute, java.lang.String key)
attribute
- the attribute valuekey
- the keypublic java.lang.Object removeAttributeForKey(java.lang.String key)
key
- the name of the attribute to remove
public java.lang.Object attributeForKey(java.lang.String key)
key
- the key
public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Object> attributes()
public void addChild(ERXRestRequestNode child)
child
- the child to addpublic com.webobjects.foundation.NSArray<ERXRestRequestNode> children()
public java.lang.String toString()
toString
in class java.lang.Object
protected void toString(java.lang.StringBuffer sb, int depth)
public java.lang.Object objectWithFilter(java.lang.String entityName, ERXKeyFilter keyFilter, IERXRestDelegate delegate)
entityName
- the entity name of the object to usekeyFilter
- the filter to use for determining which keys can be updated (or null for no update)delegate
- the delegate to use
public java.lang.Object createObjectWithFilter(java.lang.String entityName, ERXKeyFilter keyFilter, IERXRestDelegate delegate)
entityName
- the entity name of the object to usekeyFilter
- the filter to use for determining which keys can be updated (or null for no update)delegate
- the delegate to use
protected void _addAttributeNodeForKeyInObject(ERXKey<?> key, java.lang.Object obj, ERXKeyFilter keyFilter)
protected void _addToManyRelationshipNodeForKeyOfEntityInObject(ERXKey<?> key, com.webobjects.eocontrol.EOClassDescription destinationEntity, java.lang.Object obj, ERXKeyFilter keyFilter, IERXRestDelegate delegate, java.util.Set<java.lang.Object> visitedObjects)
protected void _addToOneRelationshipNodeForKeyInObject(ERXKey<?> key, java.lang.Object obj, com.webobjects.eocontrol.EOClassDescription destinationEntity, ERXKeyFilter keyFilter, IERXRestDelegate delegate, java.util.Set<java.lang.Object> visitedObjects)
protected void _addAttributesAndRelationshipsForObjectOfEntity(java.lang.Object obj, com.webobjects.eocontrol.EOClassDescription classDescription, ERXKeyFilter keyFilter, IERXRestDelegate delegate, java.util.Set<java.lang.Object> visitedObjects)
protected void _fillInWithObjectAndFilter(java.lang.Object obj, com.webobjects.eocontrol.EOClassDescription classDescription, ERXKeyFilter keyFilter, IERXRestDelegate delegate, java.util.Set<java.lang.Object> visitedObjects)
public java.lang.String toString(ERXRestFormat format)
format
- the format to use
public java.lang.String toString(IERXRestWriter writer, ERXRestFormat.Delegate delegate)
writer
- the writer to use
protected boolean isClassProperty(com.webobjects.eocontrol.EOClassDescription classDescription, java.lang.String key)
protected void _safeWillTakeValueForKey(ERXKeyFilter keyFilter, java.lang.Object target, java.lang.Object value, java.lang.String key)
protected void _safeDidTakeValueForKey(ERXKeyFilter keyFilter, java.lang.Object target, java.lang.Object value, java.lang.String key)
protected void _safeDidSkipValueForKey(ERXKeyFilter keyFilter, java.lang.Object target, java.lang.Object value, java.lang.String key)
public void updateObjectWithFilter(java.lang.Object obj, ERXKeyFilter keyFilter, IERXRestDelegate delegate)
obj
- the object to updatekeyFilter
- the filter to use to determine how to updatedelegate
- the delegatepublic static ERXRestRequestNode requestNodeWithObjectAndFilter(com.webobjects.eocontrol.EOClassDescription classDescription, java.util.List<?> objects, ERXKeyFilter keyFilter, IERXRestDelegate delegate)
classDescription
- the entity type of the objects in the arrayobjects
- the array to turn into request nodeskeyFilter
- the filter to use
public static ERXRestRequestNode requestNodeWithObjectAndFilter(java.lang.Object obj, ERXKeyFilter keyFilter, IERXRestDelegate delegate)
obj
- the object to turn into request nodeskeyFilter
- the filter to use
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |