org.jboss.metatype.api.types
Class CollectionMetaType

java.lang.Object
  extended by org.jboss.metatype.api.types.AbstractMetaType
      extended by org.jboss.metatype.api.types.CollectionMetaType
All Implemented Interfaces:
Serializable, MetaType

public class CollectionMetaType
extends AbstractMetaType

CollectionMetaType.

Author:
Ales Justin, Adrian Brock
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jboss.metatype.api.types.MetaType
ALLOWED_CLASSNAMES
 
Constructor Summary
CollectionMetaType(String className, MetaType elementType)
           
CollectionMetaType(String className, String description, MetaType elementType)
           
CollectionMetaType(String className, String typeName, String description, MetaType elementType)
           
 
Method Summary
 boolean equals(Object obj)
           
static CollectionMetaType getCollectionType(String collectionType, MetaType elementType)
          Get collection meta type.
 MetaType getElementType()
          Get the meta type of the array elements
 int hashCode()
           
 boolean isCollection()
          Retrieve whether the class name of the type is a collection
 boolean isValue(Object obj)
          Whether the passed value is one of those described by this meta type.
 String toString()
           
 
Methods inherited from class org.jboss.metatype.api.types.AbstractMetaType
getClassName, getDescription, getTypeName, isArray, isComposite, isEnum, isGeneric, isPrimitive, isProperties, isSimple, isTable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CollectionMetaType

public CollectionMetaType(String className,
                          MetaType elementType)

CollectionMetaType

public CollectionMetaType(String className,
                          String description,
                          MetaType elementType)

CollectionMetaType

public CollectionMetaType(String className,
                          String typeName,
                          String description,
                          MetaType elementType)
Method Detail

isCollection

public boolean isCollection()
Description copied from interface: MetaType
Retrieve whether the class name of the type is a collection

Specified by:
isCollection in interface MetaType
Overrides:
isCollection in class AbstractMetaType
Returns:
true when it is a collection or false otherwise

getCollectionType

public static CollectionMetaType getCollectionType(String collectionType,
                                                   MetaType elementType)
Get collection meta type.

Parameters:
collectionType - the element meta type
elementType - the element meta type
Returns:
collection meta type

getElementType

public MetaType getElementType()
Get the meta type of the array elements

Returns:
the element type

isValue

public boolean isValue(Object obj)
Description copied from interface: MetaType
Whether the passed value is one of those described by this meta type.

Specified by:
isValue in interface MetaType
Specified by:
isValue in class AbstractMetaType
Parameters:
obj - the object to test
Returns:
true when it is value for this meta type, false otherwise

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.