org.exolab.castor.mapping.loader
Class CollectionHandlers
java.lang.Object
org.exolab.castor.mapping.loader.CollectionHandlers
public final class CollectionHandlers
extends java.lang.Object
Utility class for obtaining collection handlers. Based on the
configuration and supported classes it will return collections
suitable for Java 1.1 and Java 1.2 run times.
$Revision: 1.2 $ $Date: 2003/03/03 09:57:16 $
static String | getCollectionName(Class javaClass) - Returns the associated string name for a given collection.
|
static Class | getCollectionType(String name) - Returns the collection's Java class from the collection name.
|
static CollectionHandler | getHandler(Class javaClass) - Returns the collection's handler based on the Java class.
|
static boolean | hasHandler(Class javaClass) - Returns true if the given class has an associated CollectionHandler.
|
static boolean | isGetSetCollection(Class javaClass) - Returns true if the collection requires get/set methods.
|
getCollectionName
public static String getCollectionName(Class javaClass)
Returns the associated string name for a given collection.
javaClass
- the class to search collection handlers for
- the string name for the given collection type or null
if no association has been defined.
getCollectionType
public static Class getCollectionType(String name)
throws MappingException
Returns the collection's Java class from the collection name.
The collection name may be a short name (e.g. vector)
or the collection Java class name (e.g. java.util.Vector).
If the collection is not supported, an exception is thrown.
name
- The collection name
- The collection Java class
getHandler
public static CollectionHandler getHandler(Class javaClass)
throws MappingException
Returns the collection's handler based on the Java class.
javaClass
- The collection's Java class
hasHandler
public static boolean hasHandler(Class javaClass)
Returns true if the given class has an associated CollectionHandler.
javaClass
- the class to search collection handlers for
- true if the given class has an associated CollectionHandler,
otherwise false.
isGetSetCollection
public static boolean isGetSetCollection(Class javaClass)
throws MappingException
Returns true if the collection requires get/set methods.
java.util collections only require a get method,
but an array collection required both get and set methods.
- True if collection requires get/set methods, false
if collection requires only get method
Intalio Inc. (C) 1999-2003. All rights reserved http://www.intalio.com