org.exolab.castor.xml
public final class Introspector extends Object
Version: $Revision: 1.3 $ $Date: 2003/04/23 06:42:51 $
Nested Class Summary | |
---|---|
class | Introspector.MethodSet
A simple struct for holding a set of accessor methods
|
Field Summary | |
---|---|
static String | WRAP_COLLECTIONS_PROPERTY
The property name for enabling collection wrapping.
|
Constructor Summary | |
---|---|
Introspector() |
Method Summary | |
---|---|
XMLClassDescriptor | generateClassDescriptor(Class c)
Creates an XMLClassDescriptor for the given class by using Reflection. |
XMLClassDescriptor | generateClassDescriptor(Class c, PrintWriter errorWriter)
Creates an XMLClassDescriptor for the given class by using Reflection. |
NodeType | getPrimitiveNodeType()
Returns the NodeType for java primitives
|
static boolean | introspected(XMLClassDescriptor descriptor)
Returns true if the given XMLClassDescriptor was created via
introspection
|
static boolean | isCollection(Class clazz)
Returns true if the given Class is an instance of a
collection class.
|
static boolean | marshallable(Class type)
Returns true if the given Class can be marshalled.
|
void | setNaming(XMLNaming naming)
Sets the Naming conventions to be used by the Introspector
|
void | setPrimitiveNodeType(NodeType nodeType)
Sets the NodeType for primitives. |
void | setWrapCollections(boolean wrapCollections)
Sets whether or not collections (arrays, vectors, etc)
should be wrapped in a container element. |
static String | toJavaName(String name, boolean upperFirst)
Converts the given xml name to a Java name. |
<foos> <foo>foo1</foo> <foo>foo2</foo> </foos> instead of the default: <foos>foo1<foos> <foos>foo2</foos>Use this property with a value of true or false in the castor.properties file org.exolab.castor.xml.introspector.wrapCollections=true -or- org.exolab.castor.xml.introspector.wrapCollections=false This property is false by default.
Parameters: c the Class to create the XMLClassDescriptor for
Returns: the new XMLClassDescriptor created for the given class
Throws: MarshalException when an error occurs during the creation of the ClassDescriptor.
Parameters: c the Class to create the XMLClassDescriptor for errorWriter a PrintWriter to print error information to
Returns: the new XMLClassDescriptor created for the given class
Throws: MarshalException when an error occurs during the creation of the ClassDescriptor.
Returns: the NodeType for java primitives
See Also: loadCollections
Parameters: type the Class to check marshallability for.
Returns: true if the given Class can be marshalled.
Parameters: naming the implementation of Naming to use. A value of null, will reset the XMLNaming to the default specified in the castor.properties file.
Parameters: nodeType the NodeType to use for primitive values.
<foos> <foo>foo1</foo> <foo>foo2</foo> </foos> instead of the default: <foos>foo1<foos> <foos>foo2</foos>
Parameters: wrapCollections a boolean that when true indicates collections should be wrapped in a container element.
Parameters: name the name to convert to a Java Name upperFirst a flag to indicate whether or not the the first character should be converted to uppercase.