|
JAC project AOPSYS CEDRIC & LIP6 labs |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.objectweb.jac.core.utils.Lib
Lib is a container class for various utility method used by org.objectweb.jac. None of these methods is attached to any particular jac files but should be, in an ideal world, provided by the JDK.
Constructor Summary | |
Lib()
|
Method Summary | |
static Object |
deserialize(byte[] buf)
Deserialize an object from an array of bytes. |
static Object |
deserialize(byte[] data,
Class oisClass)
Deserialize an object from an array of bytes. |
static Object[] |
enumToArray(Enumeration enum)
Transform object stored as a enumeration object into an array of object. |
static void |
exec(String command)
Execute a command in a process and dump its standard output and error. |
static Class[] |
getClasses(Object[] objs)
Get classes. |
static String[] |
getFieldsName(Object src)
Get fields name. |
static Object[] |
getFieldsValue(Object src)
Get fields value. |
static Object[] |
getFieldsValue(Object src,
String[] fieldsName)
Get fields value. |
static byte[] |
loadByteCodeFromFile(String dirName,
String fileName)
Return the byte code contained in file dirName.fileName.class |
static void |
printArray(Object o)
Recursively pretty prints an array. |
static byte[] |
serialize(Object src)
Serialize an object into an array of bytes. |
static byte[] |
serialize(Object src,
Class oosClass)
Serialize an object into an array of bytes. |
static void |
setFieldsValue(Object src,
String[] fieldsName,
Object[] fieldsValue)
Set fields value. |
static Hashtable |
stringArrayToHashtable(String[] strs)
Store a string array into a hashtable. |
static String |
stringsEnumToString(Enumeration stringsEnum)
Transform strings stored as a enumeration object into a space-separated string. |
static String[] |
stringsEnumToStringArray(Enumeration stringsEnum)
Transform strings stored as a enumeration object into an array of strings. |
static String[] |
stringToStringArray(String str)
Transform a string composed of substrings separated by spaces into an array composed of the substrings. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Lib()
Method Detail |
public static void exec(String command)
command
- the command to executepublic static String stringsEnumToString(Enumeration stringsEnum)
stringsEnum
- the enumeration object containing the strings
public static String[] stringsEnumToStringArray(Enumeration stringsEnum)
stringsEnum
- the enumeration object containing the strings
public static Object[] enumToArray(Enumeration enum)
enum
- the enumeration object containing the objects
public static String[] stringToStringArray(String str)
public static Hashtable stringArrayToHashtable(String[] strs)
strs
- the string array
public static byte[] loadByteCodeFromFile(String dirName, String fileName)
dirName
- the directory where the file is storedfileName
- the file name
public static byte[] serialize(Object src)
src
- the object to serialize
public static byte[] serialize(Object src, Class oosClass)
src
- the object to serializeoosClass
- the subclass of ObjectOutputStream
to use for serializing src
public static Object deserialize(byte[] buf)
buf
- the array of bytes
public static Object deserialize(byte[] data, Class oisClass)
data
- the array of bytesoisClass
- the subclass of ObjectInputStream
to use for deserializing src
public static String[] getFieldsName(Object src)
src
- the source object containing the fields
public static Object[] getFieldsValue(Object src)
src
- the source object containing the fields
public static Object[] getFieldsValue(Object src, String[] fieldsName)
src
- the source object containing the fieldsfieldsName
- the fields name
public static void setFieldsValue(Object src, String[] fieldsName, Object[] fieldsValue)
src
- the source objectpublic static Class[] getClasses(Object[] objs)
objs
- the objects as an array
public static void printArray(Object o)
o
- the array
|
Contact JAC development team: Renaud Pawlak Lionel Seinturier Laurent Martelli |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |