org.jboss.metatype.api.types
Class AbstractMetaType

java.lang.Object
  extended by org.jboss.metatype.api.types.AbstractMetaType
All Implemented Interfaces:
Serializable, MetaType
Direct Known Subclasses:
AbstractCompositeMetaType, ArrayMetaType, CollectionMetaType, EnumMetaType, GenericMetaType, ImmutableTableMetaType, PropertiesMetaType, SimpleMetaType

public abstract class AbstractMetaType
extends Object
implements MetaType

AbstractMetaType.

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
protected AbstractMetaType(String className)
          Construct a new MetaType.
protected AbstractMetaType(String className, String description)
          Construct a new MetaType.
protected AbstractMetaType(String className, String typeName, String description)
          Construct a new MetaType.
 
Method Summary
 String getClassName()
          Retrieve the class name of the values of this meta type.
 String getDescription()
          Retrieve the description of the type
 String getTypeName()
          Retrieve the name of the meta type
 boolean isArray()
          Retrieve whether the class name of the type is an array
 boolean isCollection()
          Retrieve whether the class name of the type is a collection
 boolean isComposite()
          Retrieve whether the class name of the type is composite
 boolean isEnum()
          Retrieve whether the class name of the type is an enum
 boolean isGeneric()
          Retrieve whether the class name of the type is generic
 boolean isPrimitive()
          Retrieve whether the class name of the type is a java primitive type.
 boolean isProperties()
          Return whether the type is a PropertiesMetaType type.
 boolean isSimple()
          Retrieve whether the class name of the type is simple
 boolean isTable()
          Retrieve whether the class name of the type is a table
abstract  boolean isValue(Object obj)
          Whether the passed value is one of those described by this meta type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractMetaType

protected AbstractMetaType(String className,
                           String typeName,
                           String description)
Construct a new MetaType.

The class name must be in MetaType.ALLOWED_CLASSNAMES or an array of those classes.

Parameters:
className - the name of the class implementing the meta type, cannot be null
typeName - the name of the meta type, cannot be null
description - the human readable description of the type, cannot be null
Throws:
IllegalArgumentException - for a null argument or a class is not an allowed class

AbstractMetaType

protected AbstractMetaType(String className,
                           String description)
Construct a new MetaType.

The class name must be in MetaType.ALLOWED_CLASSNAMES or an array of those classes.

Parameters:
className - the name of the class implementing the meta type, cannot be null
description - the human readable description of the type, cannot be null
Throws:
IllegalArgumentException - for a null argument or a class is not an allowed class

AbstractMetaType

protected AbstractMetaType(String className)
Construct a new MetaType. The class name must be in MetaType.ALLOWED_CLASSNAMES or an array of those classes.

Parameters:
className - the name of the class implementing the meta type, cannot be null
Throws:
IllegalArgumentException - for a null argument or a class is not an allowed class
Method Detail

getClassName

public String getClassName()
Description copied from interface: MetaType
Retrieve the class name of the values of this meta type. It is one of those listed in ALLOWED_CLASSNAMES or a (multi-dimensional) array of one of those classes.

Specified by:
getClassName in interface MetaType
Returns:
the class name

getTypeName

public String getTypeName()
Description copied from interface: MetaType
Retrieve the name of the meta type

Specified by:
getTypeName in interface MetaType
Returns:
the type name

getDescription

public String getDescription()
Description copied from interface: MetaType
Retrieve the description of the type

Specified by:
getDescription in interface MetaType
Returns:
the description

isEnum

public boolean isEnum()
Description copied from interface: MetaType
Retrieve whether the class name of the type is an enum

Specified by:
isEnum in interface MetaType
Returns:
true when it is an enum or false otherwise

isComposite

public boolean isComposite()
Description copied from interface: MetaType
Retrieve whether the class name of the type is composite

Specified by:
isComposite in interface MetaType
Returns:
true when it is composite or false otherwise

isSimple

public boolean isSimple()
Description copied from interface: MetaType
Retrieve whether the class name of the type is simple

Specified by:
isSimple in interface MetaType
Returns:
true when it is simple or false otherwise

isPrimitive

public boolean isPrimitive()
Description copied from interface: MetaType
Retrieve whether the class name of the type is a java primitive type.

Specified by:
isPrimitive in interface MetaType
Returns:

isGeneric

public boolean isGeneric()
Description copied from interface: MetaType
Retrieve whether the class name of the type is generic

Specified by:
isGeneric in interface MetaType
Returns:
true when it is generic or false otherwise

isTable

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

Specified by:
isTable in interface MetaType
Returns:
true when it is a table or false otherwise

isArray

public boolean isArray()
Description copied from interface: MetaType
Retrieve whether the class name of the type is an array

Specified by:
isArray in interface MetaType
Returns:
true when it is an array or false otherwise

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
Returns:
true when it is a collection or false otherwise

isProperties

public boolean isProperties()
Description copied from interface: MetaType
Return whether the type is a PropertiesMetaType type.

Specified by:
isProperties in interface MetaType
Returns:
true if type is a PropertiesMetaType
See Also:
PropertiesMetaType

isValue

public abstract 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
Parameters:
obj - the object to test
Returns:
true when it is value for this meta type, false otherwise


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