org.jboss.metatype.api.types
Class ArrayMetaType

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

public class ArrayMetaType
extends AbstractMetaType

ArrayMetaType.

Version:
$Revision: 1.1 $
Author:
Adrian Brock
See Also:
Serialized Form

Field Summary
 
Fields inherited from interface org.jboss.metatype.api.types.MetaType
ALLOWED_CLASSNAMES
 
Constructor Summary
ArrayMetaType(int dimension, MetaType elementType)
          Construct an ArrayMetaType.
ArrayMetaType(int dimension, MetaType elementType, boolean primitiveArray)
          Construct an ArrayMetaType.
ArrayMetaType(SimpleMetaType elementType, boolean primitiveArray)
          Construct an ArrayMetaType.
 
Method Summary
 boolean equals(Object obj)
           
static ArrayMetaType getArrayType(MetaType elementType)
          Get array meta type.
 int getDimension()
          Get the dimension of the array
 MetaType getElementType()
          Get the meta type of the array elements
static ArrayMetaType getPrimitiveArrayType(Class<?> arrayClass)
          Get primitive array meta type.
static String getPrimitiveEncoding(String typeName)
          Get the char encoding string for the type name.
static SimpleMetaType getPrimitiveMetaType(String primitiveTypeName)
          Get primitive meta type.
static String getPrimitiveName(String typeName)
          Get the char encoding string for the type name.
 int hashCode()
           
 boolean isPrimitiveArray()
          Is primitive array.
static boolean isPrimitiveEncoding(String primitiveKey)
          Is primitive key.
 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, isCollection, isComposite, isEnum, isGeneric, isPrimitive, isProperties, isSimple, isTable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ArrayMetaType

public ArrayMetaType(int dimension,
                     MetaType elementType)
Construct an ArrayMetaType.

Parameters:
dimension - the number of dimensions in the array
elementType - the open type of the array elements
Throws:
IllegalArgumentException - for a null argument or non-negative dimension or when meta type is an ArrayMetaType

ArrayMetaType

public ArrayMetaType(SimpleMetaType elementType,
                     boolean primitiveArray)
Construct an ArrayMetaType.

Parameters:
elementType - the element type
primitiveArray - is primitive array

ArrayMetaType

public ArrayMetaType(int dimension,
                     MetaType elementType,
                     boolean primitiveArray)
Construct an ArrayMetaType.

Parameters:
dimension - the number of dimensions in the array
elementType - the open type of the array elements
primitiveArray - is primitive array
Throws:
IllegalArgumentException - for a null argument or non-negative dimension or when meta type is an ArrayMetaType
Method Detail

isPrimitiveEncoding

public static boolean isPrimitiveEncoding(String primitiveKey)
Is primitive key.

Parameters:
primitiveKey - the key to check
Returns:
true if key is primitive

getPrimitiveMetaType

public static SimpleMetaType getPrimitiveMetaType(String primitiveTypeName)
Get primitive meta type.

Parameters:
primitiveTypeName - primitive type name
Returns:
primitive meta type or null if param is not primitive

getPrimitiveEncoding

public static String getPrimitiveEncoding(String typeName)
Get the char encoding string for the type name.

Parameters:
typeName - - the primitive wrapper type name
Returns:
char encoding string.

getPrimitiveName

public static String getPrimitiveName(String typeName)
Get the char encoding string for the type name.

Parameters:
typeName - - the primitive wrapper type name
Returns:
primitive type name string.

getArrayType

public static ArrayMetaType getArrayType(MetaType elementType)
Get array meta type.

Parameters:
elementType - the element meta type
Returns:
array meta type

getPrimitiveArrayType

public static ArrayMetaType getPrimitiveArrayType(Class<?> arrayClass)
Get primitive array meta type.

Parameters:
arrayClass - array class
Returns:
array meta type

getDimension

public int getDimension()
Get the dimension of the array

Returns:
the dimension

getElementType

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

Returns:
the element type

isPrimitiveArray

public boolean isPrimitiveArray()
Is primitive array.

Returns:
true for primitive array

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 © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.