ERXRestFormat Class Reference

Collaboration diagram for ERXRestFormat:

Collaboration graph
[legend]

List of all members.

Classes

interface  Delegate
class  NoOpDelegate

Public Member Functions

ERXRestFormat.Delegate delegate ()
 ERXRestFormat (String name, IERXRestParser parser, IERXRestWriter writer, ERXRestFormat.Delegate delegate)
String name ()
ERXRestRequestNode parse (String str)
IERXRestParser parser ()
String toString ()
String toString (EOClassDescription classDescription, List<?> list, ERXKeyFilter filter, IERXRestDelegate delegate)
String toString (Object obj, ERXKeyFilter filter, IERXRestDelegate delegate)
String toString (Object obj, IERXRestDelegate delegate)
String toString (Object obj)
IERXRestWriter writer ()

Static Public Member Functions

static ERXRestFormat formatNamed (String name)
static ERXRestFormat registerFormatNamed (ERXRestFormat format, String name)
static ERXRestFormat registerFormatNamed (IERXRestParser parser, IERXRestWriter writer, ERXRestFormat.Delegate delegate, String...names)

Static Public Attributes

static ERXRestFormat GIANDUIA_JSON = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXGianduiaRestWriter(false), new ERXRestFormatDelegate(), "gndj", "application/gndj")
static ERXRestFormat GIANDUIA_PERSISTENT_STORE = ERXRestFormat.registerFormatNamed(new ERXGianduiaRestParser(), new ERXGianduiaRestWriter(true), new ERXRestFormatDelegate(), "gndp", "application/gndp")
static ERXRestFormat HTML = ERXRestFormat.registerFormatNamed(null, new ERXSimpleRestWriter(), new ERXRestFormatDelegate(), "html", "text/html")
static ERXRestFormat JS = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXJSONRestWriter(), new ERXRestFormatDelegate(), "js", "text/js")
static ERXRestFormat JSON = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXJSONRestWriter(), new ERXRestFormatDelegate(), "json", "application/json")
static ERXRestFormat PLIST = ERXRestFormat.registerFormatNamed(new ERXPListRestParser(), new ERXPListRestWriter(), new ERXRestFormatDelegate(), "plist", "text/plist")
static ERXRestFormat RAILS = ERXRestFormat.registerFormatNamed(new ERXXmlRestParser(), new ERXXmlRestWriter(), new ERXRestFormatDelegate("id", "type", "nil", true, true, true, true), "rails", "application/xml", "text/xml")
static ERXRestFormat SPROUTCORE = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXSproutCoreRestWriter(), new ERXRestFormatDelegate("guid", "type", "nil", true, true, true, false), "sc", "application/sc")
static ERXRestFormat XML = ERXRestFormat.registerFormatNamed(new ERXXmlRestParser(), new ERXXmlRestWriter(), new ERXRestFormatDelegate(), "xml", "application/xml", "text/xml")

Private Attributes

ERXRestFormat.Delegate _delegate
String _name
IERXRestParser _parser
IERXRestWriter _writer

Static Private Attributes

static Map< String, ERXRestFormat_formats = new ConcurrentHashMap<String, ERXRestFormat>()


Constructor & Destructor Documentation

ERXRestFormat ( String  name,
IERXRestParser  parser,
IERXRestWriter  writer,
ERXRestFormat.Delegate  delegate 
)


Member Function Documentation

ERXRestFormat.Delegate delegate (  ) 

static ERXRestFormat formatNamed ( String  name  )  [static]

String name (  ) 

Returns the name of this format.

Returns:
the name of this format

ERXRestRequestNode parse ( String  str  ) 

Returns a parsed ERXRestRequestNode using this format's parser.

Parameters:
str the string to parse
Returns:
the parsed request node

IERXRestParser parser (  ) 

static ERXRestFormat registerFormatNamed ( ERXRestFormat  format,
String  name 
) [static]

static ERXRestFormat registerFormatNamed ( IERXRestParser  parser,
IERXRestWriter  writer,
ERXRestFormat.Delegate  delegate,
String...  names 
) [static]

String toString (  ) 

String toString ( EOClassDescription  classDescription,
List<?>  list,
ERXKeyFilter  filter,
IERXRestDelegate  delegate 
)

Returns the formatted version of the given list.

Parameters:
classDescription the class description for the elements of the list
list the list
filter the filter
delegate the rest delegate to use
Returns:
list rendered using this format

String toString ( Object  obj,
ERXKeyFilter  filter,
IERXRestDelegate  delegate 
)

Returns the formatted version of the given object.

Parameters:
obj the object to render
filter the filter to apply to the object
delegate the rest delegate to use
Returns:
obj rendered using this format

String toString ( Object  obj,
IERXRestDelegate  delegate 
)

Returns the formatted version of the given object using a recursive "All" filter.

Parameters:
obj the object to render
delegate the rest delegate to use
Returns:
obj rendered using this format

String toString ( Object  obj  ) 

Returns the formatted version of the given object using a recursive "All" filter and the default rest delegate.

Parameters:
obj the object to render
Returns:
obj rendered using this format

IERXRestWriter writer (  ) 


Member Data Documentation

ERXRestFormat.Delegate _delegate [private]

Map<String, ERXRestFormat> _formats = new ConcurrentHashMap<String, ERXRestFormat>() [static, private]

String _name [private]

ERXRestFormat GIANDUIA_JSON = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXGianduiaRestWriter(false), new ERXRestFormatDelegate(), "gndj", "application/gndj") [static]

ERXRestFormat GIANDUIA_PERSISTENT_STORE = ERXRestFormat.registerFormatNamed(new ERXGianduiaRestParser(), new ERXGianduiaRestWriter(true), new ERXRestFormatDelegate(), "gndp", "application/gndp") [static]

ERXRestFormat HTML = ERXRestFormat.registerFormatNamed(null, new ERXSimpleRestWriter(), new ERXRestFormatDelegate(), "html", "text/html") [static]

ERXRestFormat JS = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXJSONRestWriter(), new ERXRestFormatDelegate(), "js", "text/js") [static]

ERXRestFormat JSON = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXJSONRestWriter(), new ERXRestFormatDelegate(), "json", "application/json") [static]

ERXRestFormat PLIST = ERXRestFormat.registerFormatNamed(new ERXPListRestParser(), new ERXPListRestWriter(), new ERXRestFormatDelegate(), "plist", "text/plist") [static]

ERXRestFormat RAILS = ERXRestFormat.registerFormatNamed(new ERXXmlRestParser(), new ERXXmlRestWriter(), new ERXRestFormatDelegate("id", "type", "nil", true, true, true, true), "rails", "application/xml", "text/xml") [static]

ERXRestFormat SPROUTCORE = ERXRestFormat.registerFormatNamed(new ERXJSONRestParser(), new ERXSproutCoreRestWriter(), new ERXRestFormatDelegate("guid", "type", "nil", true, true, true, false), "sc", "application/sc") [static]

ERXRestFormat XML = ERXRestFormat.registerFormatNamed(new ERXXmlRestParser(), new ERXXmlRestWriter(), new ERXRestFormatDelegate(), "xml", "application/xml", "text/xml") [static]


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

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