ERXDictionaryRestResponseWriter Class Reference

Inherits er::rest::entityDelegates::ERXAbstractRestResponseWriter.

Collaboration diagram for ERXDictionaryRestResponseWriter:

Collaboration graph
[legend]

List of all members.

Public Member Functions

Object current ()
 ERXDictionaryRestResponseWriter (ERXKeyFilter filter)
 ERXDictionaryRestResponseWriter (boolean displayAllProperties, boolean displayAllToMany)
 ERXDictionaryRestResponseWriter ()
Object root ()

Protected Member Functions

void addToCollection (String name, Object value)
void appendArrayToResponse (ERXRestContext context, IERXRestResponse response, ERXRestKey result, String arrayName, String entityName, NSArray valueKeys, int indent, NSMutableSet< Object > visitedObjects) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException, ParseException
void appendDetailsToResponse (ERXRestContext context, IERXRestResponse response, EOEntity entity, EOEnterpriseObject eo, String objectName, String entityName, Object id, NSArray displayKeys, int indent, NSMutableSet< Object > visitedObjects) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException, ParseException
void appendNoDetailsToResponse (ERXRestContext context, IERXRestResponse response, EOEntity entity, EOEnterpriseObject eo, String objectName, String entityName, Object id, int indent)
void appendPrimitiveToResponse (ERXRestContext context, IERXRestResponse response, ERXRestKey result, int indent, Object value) throws ERXRestException
void appendVisitedToResponse (ERXRestContext context, IERXRestResponse response, EOEntity entity, EOEnterpriseObject eo, String objectName, String entityName, Object id, int indent)

Private Attributes

Stack< Object > _stack


Detailed Description

Provides the common output methods for generating a dictionary response, which can be used by several other writers (json, plist, etc).

Author:
mschrag

Constructor & Destructor Documentation

Constructs an ERXDictionaryRestResponseWriter with displayAllProperties = false.

ERXDictionaryRestResponseWriter ( boolean  displayAllProperties,
boolean  displayAllToMany 
)

Constructs an ERXDictionaryRestResponseWriter.

Parameters:
displayAllProperties if true, by default all properties are eligible to be displayed (probably should only be true in development, but it won't really hurt anything). Note that entity delegates will still control permissions on the properties, it just defaults to checking all of them.
displayAllToMany if true, all to-many relationships will be displayed

Constructs an ERXDictionaryRestResponseWriter.

Parameters:
filter the filter to apply to the written results


Member Function Documentation

void addToCollection ( String  name,
Object  value 
) [protected]

void appendArrayToResponse ( ERXRestContext  context,
IERXRestResponse  response,
ERXRestKey  key,
String  arrayName,
String  entityName,
NSArray  valueKeys,
int  indent,
NSMutableSet< Object >  visitedObjects 
) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException, ParseException [protected, virtual]

Writes the given array of objects to the response. Permissions have already been checked by the time this method is called.

Parameters:
context the rest context
response the response
key the current key
arrayName the name of the array in the context of its parent
entityName the entity name of the contents of the array
valueKeys an array of ERXRestKeys that represent the entries in the array
indent the indent level
visitedObjects the list of objects that have been visited already in this request (to prevent infinite loops)
Exceptions:
ERXRestException if a general error occurs
ERXRestSecurityException if a security error occurs
ERXRestNotFoundException if an object is not found
ParseException if a parse error occurs

Implements ERXAbstractRestResponseWriter.

void appendDetailsToResponse ( ERXRestContext  context,
IERXRestResponse  response,
EOEntity  entity,
EOEnterpriseObject  eo,
String  objectName,
String  entityName,
Object  id,
NSArray  displayKeys,
int  indent,
NSMutableSet< Object >  visitedObjects 
) throws ERXRestException, ERXRestSecurityException, ERXRestNotFoundException, ParseException [protected, virtual]

Writes the visible details of an object to the response. Permissions have already been checked by the time this method is called.

Parameters:
context the rest context
response the response
entity the entity of the object
eo the current object
objectName the name of the object (relative to its parent)
entityName the entity name of the object
id the id of the object
displayKeys the list of ERXRestKeys to display
indent the indent level
visitedObjects the list of objects that have been visited already in this request (to prevent infinite loops)
Exceptions:
ERXRestException if a general error occurs
ERXRestSecurityException if a security error occurs
ERXRestNotFoundException if an object is not found
ParseException if a parse error occurs

Implements ERXAbstractRestResponseWriter.

void appendNoDetailsToResponse ( ERXRestContext  context,
IERXRestResponse  response,
EOEntity  entity,
EOEnterpriseObject  eo,
String  objectName,
String  entityName,
Object  id,
int  indent 
) [protected, virtual]

Write an object to the response without showing its details. This is typically similar to appendVisitedToResponse, but is provided as a separate call because it is semantically a different scenario. Permissions have already been checked by the time this method is called.

Parameters:
context the rest context
response the response
entity the entity of the object
eo the current object
objectName the name of the object (relative to its parent)
entityName the entity name of the object
id the id of the object
indent the indent level

Implements ERXAbstractRestResponseWriter.

void appendPrimitiveToResponse ( ERXRestContext  context,
IERXRestResponse  response,
ERXRestKey  result,
int  indent,
Object  value 
) throws ERXRestException [protected, virtual]

Writes the bare primitive out to the response. Permissions have already been checked by the time this method is called.

Parameters:
context the rest context
response the response
result the current key
indent the indent level
value the value to append
Exceptions:
ERXRestException if a general failure occurs

Implements ERXAbstractRestResponseWriter.

void appendVisitedToResponse ( ERXRestContext  context,
IERXRestResponse  response,
EOEntity  entity,
EOEnterpriseObject  eo,
String  objectName,
String  entityName,
Object  id,
int  indent 
) [protected, virtual]

Write an object to the response that has already been visited. Typically this would just write out the type and id of the object, to prevent entering an infinite loop in the renderer. Permissions have already been checked by the time this method is called.

Parameters:
context the rest context
response the response
entity the entity of the object
eo the current object
objectName the name of the object (relative to its parent)
entityName the entity name of the object
id the id of the object
indent the indent level

Implements ERXAbstractRestResponseWriter.

Object current (  ) 

Object root (  ) 


Member Data Documentation

Stack<Object> _stack [private]


The documentation for this class was generated from the following file:

Generated on Sat May 26 06:43:28 2012 for Project Wonder by  doxygen 1.5.8