public class DataObjectHelper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
COPYRIGHT
IBM Copyright notice field.
|
Constructor and Description |
---|
DataObjectHelper() |
Modifier and Type | Method and Description |
---|---|
static void |
changeKeyInMap(java.util.Map<java.lang.String,java.lang.Object> map,
java.lang.String oldKey,
java.lang.String newKey)
Change a key name in a map.
|
static java.util.Map<java.lang.String,java.lang.Object> |
createIntermediary(commonj.sdo.DataObject dataArea,
java.lang.String resourceName,
java.lang.String urlParamGrpName,
boolean flattenNoun)
This method create intermediary Map for a DataObject based on Map and BOD mapping configuration file
for the resource.
|
static void |
flattenListOfMap(java.util.Map<java.lang.String,java.lang.Object> map,
java.lang.String key,
boolean force)
This method will call map.get(key).
|
static void |
setResourceIdByIdentifier(java.util.Map<java.lang.String,java.lang.Object> dataMap,
java.lang.String identifier,
java.lang.String requestUri,
java.lang.String lastPathElement)
Derive resource id based on requestUri and the value of its ID.
|
static void |
setResourceIdByKey(java.util.Map<java.lang.String,java.lang.Object> dataMap,
java.lang.String idKey,
java.lang.String requestUri,
java.lang.String lastPathElement)
Derive resource id based on requestUri and the value of its ID.
|
public static final java.lang.String COPYRIGHT
public static java.util.Map<java.lang.String,java.lang.Object> createIntermediary(commonj.sdo.DataObject dataArea, java.lang.String resourceName, java.lang.String urlParamGrpName, boolean flattenNoun)
dataArea
- the data arearesourceName
- the resource nameurlParamGrpName
- the url param grp nameflattenNoun
- the flatten nounpublic static void setResourceIdByKey(java.util.Map<java.lang.String,java.lang.Object> dataMap, java.lang.String idKey, java.lang.String requestUri, java.lang.String lastPathElement)
dataMap
- A mapidKey
- The key for resource identifier in map.requestUri
- The request URI path.lastPathElement
- The last path element on URI path that is used to construct resource id.public static void setResourceIdByIdentifier(java.util.Map<java.lang.String,java.lang.Object> dataMap, java.lang.String identifier, java.lang.String requestUri, java.lang.String lastPathElement)
dataMap
- A mapidentifier
- the identifierrequestUri
- The request URI path.lastPathElement
- The last path element on URI path that is used to construct resource id.public static void flattenListOfMap(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String key, boolean force)
map
- the mapkey
- the keyforce
- Always do it even if the List contains more than one itempublic static void changeKeyInMap(java.util.Map<java.lang.String,java.lang.Object> map, java.lang.String oldKey, java.lang.String newKey)
map
- the mapoldKey
- the old keynewKey
- the new key