public class ValueObject
extends java.lang.Object
implements java.util.Map, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DATE_FORMAT_COMPACT |
static java.lang.String |
DATE_FORMAT_DEFAULT |
static java.lang.String |
DATE_FORMAT_MILLIS
Timestamp in milliseconds (a stringified Java
long value). |
static java.lang.String |
PATH_DELIMS |
Constructor and Description |
---|
ValueObject() |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.String path,
java.lang.Object value) |
void |
clear() |
boolean |
containsKey(java.lang.Object key) |
boolean |
containsValue(java.lang.Object value) |
void |
createEvalListMap()
Evaluate each path in the tokenizerMap as if evaluating against a condition and
save the resulting EvalList objects in a map for later user.
|
static java.lang.String |
dateToString(java.util.Date src)
Format a Date value as a String, using the usual "American" format with
the current time zone.
|
static java.lang.String |
dateToString(java.util.Date date,
java.lang.String simpleDateFormatPattern) |
static java.util.List |
decodeCommaString(java.lang.String src)
Parse a comma delimited string into a List of strings.
|
static java.util.List |
decodeCommaString(java.lang.String src,
boolean filterEmpty) |
java.util.Set |
entrySet() |
static void |
flattenList(java.util.List inList,
java.util.List retList)
Flatten out an input list that may contain list entries.
|
java.lang.Object |
get(java.lang.Object key)
Retrieve a path from the ValueObject based on the specified key.
|
java.util.Map |
getAttributes() |
boolean |
getBoolean(java.lang.String name) |
java.util.Date |
getDate(java.lang.String name)
Coerce an object into a date.
|
java.util.Date |
getDate(java.lang.String name,
boolean throwExceptions)
Coerce an object into a date.
|
int |
getEvalListMapSize() |
static int |
getInt(java.lang.Object v)
Coerce an
Object into an int primitive. |
int |
getInt(java.lang.String name)
Coerce an
Object into an int primitive. |
java.util.List |
getList(java.lang.String name) |
java.util.List |
getListOfStrings(java.lang.String name) |
java.lang.Object |
getLocal(java.lang.String keyName)
Retrieve value by key, using alias for key if one exists
|
long |
getLong(java.lang.String name)
Coerce an
Object value into a long primitive. |
ValueObject |
getObject(java.lang.String name) |
java.lang.String |
getPathToRoot() |
java.lang.String |
getString(java.lang.String name) |
java.util.Map |
getTokenizerMap() |
boolean |
isEmpty() |
static boolean |
isPath(java.lang.String s)
Determine if string is a path.
|
java.util.Set |
keySet() |
java.lang.Object |
put(java.lang.Object key,
java.lang.Object value) |
void |
putAll(java.util.Map src) |
void |
putAttributesNoPath(java.util.Map attrs) |
java.lang.Object |
remove(java.lang.Object key) |
void |
setSavePath(boolean savePath) |
void |
setTokenizerMap(java.util.Map tmpMap) |
void |
setTokenizerPathMap(java.util.Map tmpMap) |
int |
size() |
static void |
splitPathAroundLastDot(java.lang.String tmpPath,
java.lang.StringBuilder sbVo,
java.lang.StringBuilder sbAttr)
Divide up a path based on the last '.' in the path.
|
static java.util.Date |
stringToDate(java.lang.String src) |
java.lang.String |
toString() |
java.util.Collection |
values() |
public static final java.lang.String PATH_DELIMS
public static final java.lang.String DATE_FORMAT_MILLIS
long
value).public static final java.lang.String DATE_FORMAT_COMPACT
public static final java.lang.String DATE_FORMAT_DEFAULT
public void add(java.lang.String path, java.lang.Object value)
public boolean getBoolean(java.lang.String name)
public java.util.Date getDate(java.lang.String name)
public java.util.Date getDate(java.lang.String name, boolean throwExceptions) throws ValueObjectException
ValueObjectException
public int getInt(java.lang.String name)
Object
into an int
primitive.public java.util.List getList(java.lang.String name)
public java.util.List getListOfStrings(java.lang.String name)
public long getLong(java.lang.String name)
Object
value into a long
primitive.public ValueObject getObject(java.lang.String name)
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getString(java.lang.String name)
public java.util.Map getAttributes()
public void putAttributesNoPath(java.util.Map attrs)
public int size()
size
in interface java.util.Map
public boolean isEmpty()
isEmpty
in interface java.util.Map
public boolean containsKey(java.lang.Object key)
containsKey
in interface java.util.Map
public boolean containsValue(java.lang.Object value)
containsValue
in interface java.util.Map
public java.lang.Object get(java.lang.Object key)
get
in interface java.util.Map
key
- public java.lang.Object put(java.lang.Object key, java.lang.Object value) throws java.lang.IllegalArgumentException
put
in interface java.util.Map
java.lang.IllegalArgumentException
public java.lang.Object remove(java.lang.Object key) throws java.lang.IllegalArgumentException
remove
in interface java.util.Map
java.lang.IllegalArgumentException
public void putAll(java.util.Map src)
putAll
in interface java.util.Map
public void clear()
clear
in interface java.util.Map
public java.util.Set keySet()
keySet
in interface java.util.Map
public java.util.Collection values()
values
in interface java.util.Map
public java.util.Set entrySet()
entrySet
in interface java.util.Map
public java.lang.Object getLocal(java.lang.String keyName)
keyName
- - Name of the key, may be an aliaspublic java.lang.String getPathToRoot()
public void setSavePath(boolean savePath)
public void createEvalListMap()
public void setTokenizerMap(java.util.Map tmpMap)
public void setTokenizerPathMap(java.util.Map tmpMap)
public java.util.Map getTokenizerMap()
public int getEvalListMapSize()
public static java.lang.String dateToString(java.util.Date src)
public static java.lang.String dateToString(java.util.Date date, java.lang.String simpleDateFormatPattern)
public static boolean isPath(java.lang.String s)
s
- public static int getInt(java.lang.Object v)
Object
into an int
primitive.v
- number or string representation of a numberpublic static void flattenList(java.util.List inList, java.util.List retList)
inList
- retList
- public static void splitPathAroundLastDot(java.lang.String tmpPath, java.lang.StringBuilder sbVo, java.lang.StringBuilder sbAttr)
tmpPath
- sbVo
- sbAttr
- public static java.util.List decodeCommaString(java.lang.String src)
src
- comma separated list of valuespublic static java.util.List decodeCommaString(java.lang.String src, boolean filterEmpty)
public static java.util.Date stringToDate(java.lang.String src) throws java.text.ParseException
java.text.ParseException