public class ERXRestUtils extends Object
Name | Description |
---|---|
er.rest.dateFormat | er.rest.dateFormat |
er.rest.timestampFormat | er.rest.timestampFormat |
er.rest.rfcDateFormat | (default "rfc822") |
er.rest.javaFormatDate | er.rest.javaFormatDate |
er.rest.javaFormatDateTime | er.rest.javaFormatDateTime |
er.rest.javaFormatTime | er.rest.javaFormatTime |
er.rest.jodaFormat | er.rest.jodaFormat |
er.rest.jodaFormatTime | er.rest.jodaFormatTime |
Constructor and Description |
---|
ERXRestUtils() |
Modifier and Type | Method and Description |
---|---|
static Object |
coerceValueToAttributeType(Object value,
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 |
javaDateFormat(ERXRestContext context) |
protected static DateTimeFormatter |
javaDateTimeFormat(ERXRestContext context) |
protected static DateTimeFormatter |
javaTimeFormat(ERXRestContext context) |
protected static org.joda.time.format.DateTimeFormatter |
jodaLocalDateFormat(boolean spaces,
ERXRestContext context) |
protected static org.joda.time.format.DateTimeFormatter |
jodaLocalDateTimeFormat(boolean spaces,
ERXRestContext context) |
protected static Format |
timestampFormat(boolean spaces,
ERXRestContext context) |
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 org.joda.time.format.DateTimeFormatter jodaLocalDateFormat(boolean spaces, ERXRestContext context)
protected static org.joda.time.format.DateTimeFormatter jodaLocalDateTimeFormat(boolean spaces, ERXRestContext context)
protected static DateTimeFormatter javaDateFormat(ERXRestContext context)
protected static DateTimeFormatter javaDateTimeFormat(ERXRestContext context)
protected static DateTimeFormatter javaTimeFormat(ERXRestContext context)
public static Object coerceValueToTypeNamed(Object value, String valueTypeName, ERXRestContext context, boolean resolveEntities)
public static Object coerceValueToAttributeType(Object value, 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 – 2024 Project Wonder.