com.adobe.livecycle.rca.common.utils
Class StringUtils

java.lang.Object
  extended by com.adobe.livecycle.rca.common.utils.StringUtils

public class StringUtils
extends Object

This class provide helper utilities for string conversion and manipulation


Constructor Summary
StringUtils()
           
 
Method Summary
 Map arrayToMap(Object[][] data, Class keyClass, Class valueClass)
          Converts an array to map
static Serializable bytesToSerializable(byte[] data)
          Deserialize a byte array
static byte[] documentToBytes(com.adobe.idp.Document document)
          Converts an Document object to byte array
static Date getDateFromString(String dateString)
           
static String getDateString(Date date)
           
static String listToString(List input)
           
static Locale resolveLocale(String name)
          Create Locale object from the string
static byte[] serializableToBytes(Serializable data)
          convert Serializable object to byte array
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StringUtils

public StringUtils()
Method Detail

resolveLocale

public static Locale resolveLocale(String name)
Create Locale object from the string

Parameters:
name - name of the location like en_US
Returns:
Locale object

documentToBytes

public static byte[] documentToBytes(com.adobe.idp.Document document)
                              throws IOException
Converts an Document object to byte array

Parameters:
document - document object
Returns:
byte array
Throws:
IOException - if there is any error reading the byte stream from document

serializableToBytes

public static byte[] serializableToBytes(Serializable data)
                                  throws IOException
convert Serializable object to byte array

Parameters:
data - Serializable object
Returns:
byte array
Throws:
IOException - if there is any error reading the input data

bytesToSerializable

public static Serializable bytesToSerializable(byte[] data)
                                        throws IOException,
                                               ClassNotFoundException
Deserialize a byte array

Parameters:
data - byte array
Returns:
Serializable object
Throws:
IOException - if there is any error reading/writing to the stream
ClassNotFoundException - if the class represented in the serialized data is not found in the class path

arrayToMap

public Map arrayToMap(Object[][] data,
                      Class keyClass,
                      Class valueClass)
Converts an array to map

Parameters:
data - Array of objects
keyClass - Class of Type K
valueClass - Class of Type V
Returns:
Map of objects

listToString

public static String listToString(List input)

getDateFromString

public static Date getDateFromString(String dateString)

getDateString

public static String getDateString(Date date)


[an error occurred while processing this directive] [an error occurred while processing this directive]