public class ERXRestUtils extends Object
Name | Description |
---|---|
er.rest.dateFormat | er.rest.dateFormat |
er.rest.timestampFormat | er.rest.timestampFormat |
er.rest.rfcDateFormat | (default "rfc822") |
Modifier and Type | Field and Description |
---|---|
protected static DateTimeFormatter |
DATE_FORMATTER |
protected static DateTimeFormatter |
DATE_TIME_FORMATTER |
protected static DateTimeFormatter |
TIME_FORMATTER |
Constructor and Description |
---|
ERXRestUtils() |
Modifier and Type | Method and Description |
---|---|
static Object |
coerceValueToAttributeType(Object value,
com.webobjects.eocontrol.EOClassDescription parentEntity,
Object parentObject,
String attributeName,
ERXRestContext context)
Parses the given String and returns an object.
|
static String |
coerceValueToString(Object value,
ERXRestContext context)
Convert the given object to a String (using REST formats).
|
static Object |
coerceValueToTypeNamed(Object value,
String valueTypeName,
ERXRestContext context,
boolean resolveEntities) |
protected static Format |
dateFormat(boolean spaces,
ERXRestContext context) |
static boolean |
isPrimitive(Class<?> valueType)
Returns whether or not the given class represents a primitive in REST.
|
static boolean |
isPrimitive(Object obj)
Returns whether or not the given object represents a primitive in REST.
|
protected static DateTimeFormatter |
jodaLocalDateFormat(boolean spaces,
ERXRestContext context) |
protected static DateTimeFormatter |
jodaLocalDateTimeFormat(boolean spaces,
ERXRestContext context) |
protected static Format |
timestampFormat(boolean spaces,
ERXRestContext context) |
protected static final DateTimeFormatter DATE_FORMATTER
protected static final DateTimeFormatter DATE_TIME_FORMATTER
protected static final DateTimeFormatter TIME_FORMATTER
public static boolean isPrimitive(Object obj)
obj
- the object to checkpublic static boolean isPrimitive(Class<?> valueType)
valueType
- the class to checkpublic static String coerceValueToString(Object value, ERXRestContext context)
value
- the value to convertcontext
- the REST contextprotected static Format timestampFormat(boolean spaces, ERXRestContext context)
protected static Format dateFormat(boolean spaces, ERXRestContext context)
protected static DateTimeFormatter jodaLocalDateFormat(boolean spaces, ERXRestContext context)
protected static DateTimeFormatter jodaLocalDateTimeFormat(boolean spaces, ERXRestContext context)
public static Object coerceValueToTypeNamed(Object value, String valueTypeName, ERXRestContext context, boolean resolveEntities)
public static Object coerceValueToAttributeType(Object value, com.webobjects.eocontrol.EOClassDescription parentEntity, Object parentObject, String attributeName, ERXRestContext context)
value
- the value of the attributeparentEntity
- the entityparentObject
- the parent objectattributeName
- the name of the propertycontext
- the REST contextCopyright © 2002 – 2020 Project Wonder.