public class ERXRestRequestNode extends java.lang.Object implements NSKeyValueCoding, NSKeyValueCodingAdditions
| Properties | |
| Boolean property to enable null values in return. Defaults
to true. |
NSKeyValueCodingAdditions.DefaultImplementation, NSKeyValueCodingAdditions.UtilityNSKeyValueCoding._BooleanFieldBinding, NSKeyValueCoding._BooleanMethodBinding, NSKeyValueCoding._FieldBinding, NSKeyValueCoding._ForwardingBinding, NSKeyValueCoding._KeyBinding, NSKeyValueCoding._KeyBindingCreation, NSKeyValueCoding._MethodBinding, NSKeyValueCoding._NumberFieldBinding, NSKeyValueCoding._NumberMethodBinding, NSKeyValueCoding._ReflectionKeyBindingCreation, NSKeyValueCoding.ErrorHandling, NSKeyValueCoding.MapImplementation, NSKeyValueCoding.Null<T>, NSKeyValueCoding.UnknownKeyException, NSKeyValueCoding.ValueAccessor_CLASS, _KeyPathSeparatorChar, KeyPathSeparatorNullValue| Constructor and Description |
|---|
ERXRestRequestNode()
Constructs a new root node with no name.
|
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.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
_addAttributeNodeForKeyInObject(ERXKey<?> key,
java.lang.Object obj,
ERXKeyFilter keyFilter) |
protected void |
_addAttributesAndRelationshipsForObjectOfEntity(java.lang.Object obj,
EOClassDescription classDescription,
ERXKeyFilter keyFilter,
ERXRestContext context,
java.util.Set<java.lang.Object> visitedObjects) |
protected void |
_addToManyRelationshipNodeForKeyOfEntityInObject(ERXKey<?> key,
EOClassDescription destinationEntity,
java.lang.Object obj,
ERXKeyFilter keyFilter,
ERXRestContext context,
java.util.Set<java.lang.Object> visitedObjects) |
protected void |
_addToOneRelationshipNodeForKeyInObject(ERXKey<?> key,
java.lang.Object obj,
EOClassDescription destinationEntity,
ERXKeyFilter keyFilter,
ERXRestContext context,
java.util.Set<java.lang.Object> visitedObjects) |
protected void |
_fillInWithObjectAndFilter(java.lang.Object obj,
EOClassDescription classDescription,
ERXKeyFilter keyFilter,
ERXRestContext context,
java.util.Set<java.lang.Object> visitedObjects) |
void |
_removeRedundantTypes() |
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.
|
java.util.Map<java.lang.String,java.lang.Object> |
attributes()
Returns the attributes dictionary for this node.
|
ERXRestRequestNode |
childAtIndex(int index) |
ERXRestRequestNode |
childNamed(java.lang.String name)
Returns the first child named 'name'.
|
NSArray<ERXRestRequestNode> |
children()
Returns the children of this node.
|
ERXRestRequestNode |
cloneNode()
Clones this node.
|
java.lang.Object |
createObject()
Equivalent to createObjectWithFilter(null, ERXKeyFilter.filterWithAllRecursive(), new ERXRestContext());
|
java.lang.Object |
createObjectWithFilter(java.lang.String entityName,
ERXKeyFilter keyFilter,
ERXRestContext context)
Creates a new instance of an object represented by this request node.
|
protected java.lang.String |
entityName(java.lang.String suggestedEntityName) |
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(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 |
object()
Equivalent to objectWithFilter(null, ERXKeyFilter.filterWithAllRecursive(), new ERXRestContext());
|
java.lang.Object |
objectWithFilter(java.lang.String entityName,
ERXKeyFilter keyFilter,
ERXRestContext context)
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(EOClassDescription classDescription,
java.util.List<?> objects,
ERXKeyFilter keyFilter,
ERXRestContext context)
Creates a hierarchy of ERXRestRequestNodes based off of the given array of objects.
|
static ERXRestRequestNode |
requestNodeWithObjectAndFilter(java.lang.Object obj,
ERXKeyFilter keyFilter,
ERXRestContext context)
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 keyName) |
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,
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,
ERXRestContext context)
Returns a string representation of this request node using the given format.
|
java.lang.String |
toString(IERXRestWriter writer,
ERXRestFormat.Delegate delegate,
ERXRestContext context)
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 |
updateObject(java.lang.Object obj)
Equivalent to updateObjectWithFilter(obj, ERXKeyFilter.filterWithAllRecursive(), new ERXRestContext());
|
void |
updateObjectWithFilter(java.lang.Object obj,
ERXKeyFilter keyFilter,
ERXRestContext context)
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 keyName) |
java.lang.Object |
valueForKeyPath(java.lang.String keyPath) |
public ERXRestRequestNode()
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 nodepublic 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 renderingpublic 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 mappingsprotected 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, 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 keyName)
takeValueForKey in interface NSKeyValueCodingpublic java.lang.Object valueForKey(java.lang.String keyName)
valueForKey in interface NSKeyValueCodingpublic java.lang.Object valueForKeyPath(java.lang.String keyPath)
valueForKeyPath in interface NSKeyValueCodingAdditionspublic void takeValueForKeyPath(java.lang.Object value,
java.lang.String keyPath)
takeValueForKeyPath in interface NSKeyValueCodingAdditionspublic ERXRestRequestNode childAtIndex(int index)
public ERXRestRequestNode childNamed(java.lang.String name)
name - the name to look forpublic ERXRestRequestNode removeChildNamed(java.lang.String name)
name - the name of the node to removepublic 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 removepublic 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 removepublic java.lang.Object attributeForKey(java.lang.String key)
key - the keypublic java.util.Map<java.lang.String,java.lang.Object> attributes()
public void addChild(ERXRestRequestNode child)
child - the child to addpublic NSArray<ERXRestRequestNode> children()
public java.lang.String toString()
toString in class java.lang.Objectprotected void toString(java.lang.StringBuffer sb,
int depth)
protected java.lang.String entityName(java.lang.String suggestedEntityName)
public java.lang.Object object()
public java.lang.Object objectWithFilter(java.lang.String entityName,
ERXKeyFilter keyFilter,
ERXRestContext context)
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)context - the delegate to usepublic java.lang.Object createObject()
public java.lang.Object createObjectWithFilter(java.lang.String entityName,
ERXKeyFilter keyFilter,
ERXRestContext context)
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)context - the delegate to useprotected void _addAttributeNodeForKeyInObject(ERXKey<?> key, java.lang.Object obj, ERXKeyFilter keyFilter)
protected void _addToManyRelationshipNodeForKeyOfEntityInObject(ERXKey<?> key, EOClassDescription destinationEntity, java.lang.Object obj, ERXKeyFilter keyFilter, ERXRestContext context, java.util.Set<java.lang.Object> visitedObjects)
protected void _addToOneRelationshipNodeForKeyInObject(ERXKey<?> key, java.lang.Object obj, EOClassDescription destinationEntity, ERXKeyFilter keyFilter, ERXRestContext context, java.util.Set<java.lang.Object> visitedObjects)
protected void _addAttributesAndRelationshipsForObjectOfEntity(java.lang.Object obj,
EOClassDescription classDescription,
ERXKeyFilter keyFilter,
ERXRestContext context,
java.util.Set<java.lang.Object> visitedObjects)
protected void _fillInWithObjectAndFilter(java.lang.Object obj,
EOClassDescription classDescription,
ERXKeyFilter keyFilter,
ERXRestContext context,
java.util.Set<java.lang.Object> visitedObjects)
public java.lang.String toString(ERXRestFormat format, ERXRestContext context)
format - the format to usepublic java.lang.String toString(IERXRestWriter writer, ERXRestFormat.Delegate delegate, ERXRestContext context)
writer - the writer to useprotected boolean isClassProperty(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 updateObject(java.lang.Object obj)
obj - the object to updatepublic void updateObjectWithFilter(java.lang.Object obj,
ERXKeyFilter keyFilter,
ERXRestContext context)
obj - the object to updatekeyFilter - the filter to use to determine how to updatecontext - the delegatepublic void _removeRedundantTypes()
public static ERXRestRequestNode requestNodeWithObjectAndFilter(EOClassDescription classDescription, java.util.List<?> objects, ERXKeyFilter keyFilter, ERXRestContext context)
classDescription - the entity type of the objects in the arrayobjects - the array to turn into request nodeskeyFilter - the filter to usepublic static ERXRestRequestNode requestNodeWithObjectAndFilter(java.lang.Object obj, ERXKeyFilter keyFilter, ERXRestContext context)
obj - the object to turn into request nodeskeyFilter - the filter to useCopyright © 2002 – 2022 Project Wonder.