Project Wonder 5.0

er.rest
Class ERXRestUtils

java.lang.Object
  extended by er.rest.ERXRestUtils

public class ERXRestUtils
extends java.lang.Object

Miscellaneous rest-related utility methods.

Author:
mschrag

Constructor Summary
ERXRestUtils()
           
 
Method Summary
static java.lang.Object coerceValueToAttributeType(java.lang.Object value, com.webobjects.eocontrol.EOClassDescription parentEntity, java.lang.Object parentObject, java.lang.String attributeName)
          Parses the given String and returns an object.
static java.lang.String coerceValueToString(java.lang.Object value)
          Convert the given object to a String (using REST formats).
static java.lang.Object coerceValueToTypeNamed(java.lang.Object value, java.lang.String valueTypeName, IERXRestDelegate delegate)
           
protected static java.lang.String dateFormat(boolean spaces)
           
static boolean isPrimitive(java.lang.Class valueType)
          Returns whether or not the given class represents a primitive in REST.
static boolean isPrimitive(java.lang.Object obj)
          Returns whether or not the given object represents a primitive in REST.
protected static java.lang.String timestampFormat(boolean spaces)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ERXRestUtils

public ERXRestUtils()
Method Detail

isPrimitive

public static boolean isPrimitive(java.lang.Object obj)
Returns whether or not the given object represents a primitive in REST.

Parameters:
obj - the object to check
Returns:
whether or not the given object represents a primitive in REST

isPrimitive

public static boolean isPrimitive(java.lang.Class valueType)
Returns whether or not the given class represents a primitive in REST.

Parameters:
valueType - the class to check
Returns:
whether or not the given class represents a primitive in REST

coerceValueToString

public static java.lang.String coerceValueToString(java.lang.Object value)
Convert the given object to a String (using REST formats).

Parameters:
value - the value to convert
Returns:
the REST-formatted string

timestampFormat

protected static java.lang.String timestampFormat(boolean spaces)

dateFormat

protected static java.lang.String dateFormat(boolean spaces)

coerceValueToTypeNamed

public static java.lang.Object coerceValueToTypeNamed(java.lang.Object value,
                                                      java.lang.String valueTypeName,
                                                      IERXRestDelegate delegate)

coerceValueToAttributeType

public static java.lang.Object coerceValueToAttributeType(java.lang.Object value,
                                                          com.webobjects.eocontrol.EOClassDescription parentEntity,
                                                          java.lang.Object parentObject,
                                                          java.lang.String attributeName)
Parses the given String and returns an object.

Parameters:
value - the value of the attribute
parentEntity - the entity
attributeName - the name of the property
parentObject - the parent object
Returns:
a parsed version of the String

Last updated: Tue, Feb 21, 2017 • 05:45 PM CET

Copyright © 2002 – 2007 Project Wonder.