public class StorageDataUtil extends Object
| Constructor and Description |
|---|
StorageDataUtil() |
| Modifier and Type | Method and Description |
|---|---|
String |
encodeJson(String value)
Safely escape the supplied string for use in JSON.
|
String |
encodeXml(String value)
Safely escape the supplied string for use in XML.
|
String |
get(JsonSimple json,
Object... field)
Trivial wrapper for call into JSON Library.
|
String |
getDateTime(String dateTime,
String format)
Cleanup the supplied datetime value into a W3C format.
|
String |
getDefaultValueIfNull(JsonSimple json,
String defaultValue,
Object... field)
Similar to get Method but return a string supplied by caller if cannot
get the field
|
String |
getEmptyIfNull(JsonSimple json,
Object... field)
Similar to get Method but return empty string instead of null
|
List<JsonObject> |
getJavaList(JsonSimple json,
String baseKey)
getJavaList method to reconstruct an list of JSONObjects of a key from a
JsonSimple object
|
Map<String,Object> |
getList(JsonSimple json,
String baseKey)
Getlist method to get the values of key from the sourceMap
|
Map<String,Object> |
getList(Map<String,Object> sourceMap,
String baseKey)
Getlist method to get the values of key from the sourceMap
|
String |
getMetadata(DigitalObject object,
String field)
Utility method for accessing object properties.
|
JsonSimple |
getPayloadJsonSimple(Payload payload)
Get a playload in JsonSimple format from the payload instance
|
JsonSimple |
getPayloadJsonSimple(Storage storage,
String oid,
String payloadName)
Get a playload in JsonSimple format in the specified Storage instance by
its object ID and the name of payload.
|
List<String> |
getStringList(JsonSimple json,
String baseKey)
getStringList method to reconstruct an list of String of a key from a
JsonSimple object
|
String |
getW3CDateTime(String dateTime)
Cleanup the supplied datetime value into a W3C format.
|
public JsonSimple getPayloadJsonSimple(Storage storage, String oid, String payloadName)
storage - : Storage objectoid - : object IDpayloadName - : name of palyloadpublic JsonSimple getPayloadJsonSimple(Payload payload)
payload - : Payload objectpublic Map<String,Object> getList(Map<String,Object> sourceMap, String baseKey)
sourceMap - Map containerbaseKey - field to searchclasspublic Map<String,Object> getList(JsonSimple json, String baseKey)
sourceMap - Map containerbaseKey - field to searchpublic List<JsonObject> getJavaList(JsonSimple json, String baseKey)
json: - JsonSimple object of sourcebaseKey: - field to searchpublic List<String> getStringList(JsonSimple json, String baseKey)
json: - JsonSimple object of sourcebaseKey: - field to searchpublic String get(JsonSimple json, Object... field)
json: - The JSON object to get fromfield: - The field in the JSON object to getpublic String getEmptyIfNull(JsonSimple json, Object... field)
json: - The JSON object to get fromfield: - The field in the JSON object to getpublic String getDefaultValueIfNull(JsonSimple json, String defaultValue, Object... field)
json: - The JSON object to get fromdefaultValue: - The default value of the fieldfield: - The field in the JSON object to getpublic String getW3CDateTime(String dateTime) throws ParseException
dateTime - Datetime to cleanParseException - if and incorrect input is suppliedpublic String getDateTime(String dateTime, String format) throws ParseException
dateTime - Datetime to cleanParseException - if and incorrect input is suppliedpublic String getMetadata(DigitalObject object, String field)
object: - The object to extract the property fromfield: - The field name of the propertypublic String encodeXml(String value)
value: - The string to escapeCopyright © 2009-2015. All Rights Reserved.