|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.xmlctf.util.CTFUtils
public class CTFUtils
This class contains utility methods needed by the CTF.
| Field Summary | |
|---|---|
static String |
BOOLEAN
The Java primitives. |
static String |
BYTE
|
static String |
CHARACTER
|
static String |
DOUBLE
|
static String |
FLOAT
|
static String |
INT
|
static String |
LONG
|
static String |
SHORT
|
static String |
STRING
|
| Method Summary | |
|---|---|
static int |
compare(String document1,
String document2)
Compares two XML documents located at 2 given URLs, returning the number of differences or 0 if both documents are 'XML equivalent'. |
static Class |
getClass(String name,
ClassLoader loader)
Returns the class associated with the given name. |
static Object |
instantiateObject(String type,
String value,
ClassLoader loader)
Converts the given value to a Java representation that corresponds to the given type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String BOOLEAN
public static final String BYTE
public static final String CHARACTER
public static final String DOUBLE
public static final String FLOAT
public static final String INT
public static final String LONG
public static final String SHORT
public static final String STRING
| Method Detail |
|---|
public static int compare(String document1,
String document2)
throws IOException
document1 - the URL of the first XML document.document2 - the URL of the second XML document.
IOException - if an error occurs reading either XML
document
public static Class getClass(String name,
ClassLoader loader)
throws ClassNotFoundException
name - the fully qualified name of the class to return. Primitives
are handled through their name and not their class name. For
instance 'boolean' should be used instead of
'java.lang.Boolean.TYPE'.loader - the ClassLoader to use if the class needs to be loaded
ClassNotFoundException - if the given class cannot be loaded using
the provided class loader.
public static Object instantiateObject(String type,
String value,
ClassLoader loader)
throws ClassNotFoundException,
MarshalException
value - the value to be convertedtype - a string representation of the java type.loader - an optional ClassLoader used in case we need to use the
Unmarshaller to retrieve a complex java object.
ClassNotFoundException - if the type is not a recognized primitive
type and the class loader provided cannot load the type
MarshalException - if the type is not a recognized primitive type
and no Marshaller can be found for that type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||