org.exolab.castor.mapping.loader
Class CollectionHandlers

java.lang.Object
  extended byorg.exolab.castor.mapping.loader.CollectionHandlers

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.

Version:
$Revision: 1.13 $ $Date: 2001/02/16 02:37:10 $
Author:
Assaf Arkin
See Also:
CollectionHandler

Nested Class Summary
(package private) static class CollectionHandlers.EmptyEnumerator
          Enumerator for a null collection.
(package private) static class CollectionHandlers.Info
           
 
Constructor Summary
(package private) CollectionHandlers()
           
 
Method Summary
static java.lang.Class getCollectionType(java.lang.String name)
          Returns the collection's Java class from the collection name.
static CollectionHandler getHandler(java.lang.Class javaClass)
          Returns the collection's handler based on the Java class.
static boolean isGetSetCollection(java.lang.Class javaClass)
          Returns true if the collection requires get/set methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CollectionHandlers

CollectionHandlers()
Method Detail

getCollectionType

public static java.lang.Class getCollectionType(java.lang.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.

Parameters:
name - The collection name
Returns:
The collection Java class
Throws:
MappingException - The named collection is not supported

getHandler

public static CollectionHandler getHandler(java.lang.Class javaClass)
                                    throws MappingException
Returns the collection's handler based on the Java class.

Parameters:
javaClass - The collection's Java class
Returns:
The collection handler
Throws:
MappingException - The collection class is not supported

isGetSetCollection

public static boolean isGetSetCollection(java.lang.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.

Returns:
True if collection requires get/set methods, false if collection requires only get method
Throws:
MappingException - The collection class is not supported


Intalio Inc. (C) 1999-2001. All rights reserved http://www.intalio.com