org.jboss.metatype.api.types
Class SimpleMetaType

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

public class SimpleMetaType
extends AbstractMetaType

SimpleMetaType.

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

Field Summary
static SimpleMetaType BIGDECIMAL
          The simple type for java.math.BigDecimal
static SimpleMetaType BIGINTEGER
          The simple type for java.math.BigInteger
static SimpleMetaType BOOLEAN
          The simple type for java.lang.Boolean
static SimpleMetaType BOOLEAN_PRIMITIVE
           
static SimpleMetaType BYTE
          The simple type for java.lang.Byte
static SimpleMetaType BYTE_PRIMITIVE
           
static SimpleMetaType CHARACTER
          The simple type for java.lang.Character
static SimpleMetaType CHARACTER_PRIMITIVE
           
static SimpleMetaType DATE
          The simple type for java.lang.Date
static SimpleMetaType DOUBLE
          The simple type for java.lang.Double
static SimpleMetaType DOUBLE_PRIMITIVE
           
static SimpleMetaType FLOAT
          The simple type for java.lang.Float
static SimpleMetaType FLOAT_PRIMITIVE
           
static SimpleMetaType INTEGER
          The simple type for java.lang.Integer
static SimpleMetaType INTEGER_PRIMITIVE
           
static SimpleMetaType LONG
          The simple type for java.lang.Long
static SimpleMetaType LONG_PRIMITIVE
           
static SimpleMetaType NAMEDOBJECT
          The simple type for an object name
static SimpleMetaType SHORT
          The simple type for java.lang.Short
static SimpleMetaType SHORT_PRIMITIVE
           
static SimpleMetaType STRING
          The simple type for java.lang.String
static SimpleMetaType VOID
          The simple type for java.lang.Void
 
Fields inherited from interface org.jboss.metatype.api.types.MetaType
ALLOWED_CLASSNAMES
 
Method Summary
 int compare(Object first, Object second)
          Compare objects.
 boolean equals(Object obj)
           
 boolean equalsIgnorePrimitive(Object obj)
           
 int hashCode()
           
 boolean isPrimitive()
          Retrieve whether the class name of the type is a java primitive type.
 boolean isSimple()
          Retrieve whether the class name of the type is simple
static SimpleMetaType isSimpleType(String className)
          Return the simple type if the class name is a simple type otherwise null.
 boolean isValue(Object obj)
          Whether the passed value is one of those described by this meta type.
static SimpleMetaType resolve(String className)
          Resolve a simple type
 String toString()
           
 
Methods inherited from class org.jboss.metatype.api.types.AbstractMetaType
getClassName, getDescription, getTypeName, isArray, isCollection, isComposite, isEnum, isGeneric, isProperties, isTable
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

BIGDECIMAL

public static final SimpleMetaType BIGDECIMAL
The simple type for java.math.BigDecimal


BIGINTEGER

public static final SimpleMetaType BIGINTEGER
The simple type for java.math.BigInteger


BOOLEAN

public static final SimpleMetaType BOOLEAN
The simple type for java.lang.Boolean


BOOLEAN_PRIMITIVE

public static final SimpleMetaType BOOLEAN_PRIMITIVE

BYTE

public static final SimpleMetaType BYTE
The simple type for java.lang.Byte


BYTE_PRIMITIVE

public static final SimpleMetaType BYTE_PRIMITIVE

CHARACTER

public static final SimpleMetaType CHARACTER
The simple type for java.lang.Character


CHARACTER_PRIMITIVE

public static final SimpleMetaType CHARACTER_PRIMITIVE

DATE

public static final SimpleMetaType DATE
The simple type for java.lang.Date


DOUBLE

public static final SimpleMetaType DOUBLE
The simple type for java.lang.Double


DOUBLE_PRIMITIVE

public static final SimpleMetaType DOUBLE_PRIMITIVE

FLOAT

public static final SimpleMetaType FLOAT
The simple type for java.lang.Float


FLOAT_PRIMITIVE

public static final SimpleMetaType FLOAT_PRIMITIVE

INTEGER

public static final SimpleMetaType INTEGER
The simple type for java.lang.Integer


INTEGER_PRIMITIVE

public static final SimpleMetaType INTEGER_PRIMITIVE

LONG

public static final SimpleMetaType LONG
The simple type for java.lang.Long


LONG_PRIMITIVE

public static final SimpleMetaType LONG_PRIMITIVE

SHORT

public static final SimpleMetaType SHORT
The simple type for java.lang.Short


SHORT_PRIMITIVE

public static final SimpleMetaType SHORT_PRIMITIVE

STRING

public static final SimpleMetaType STRING
The simple type for java.lang.String


NAMEDOBJECT

public static final SimpleMetaType NAMEDOBJECT
The simple type for an object name


VOID

public static final SimpleMetaType VOID
The simple type for java.lang.Void

Method Detail

resolve

public static SimpleMetaType resolve(String className)
Resolve a simple type

Parameters:
className - the class name of the simple type
Returns:
the simple type
Throws:
IllegalArgumentException - for a null className or if it is not a simple type

isSimpleType

public static SimpleMetaType isSimpleType(String className)
Return the simple type if the class name is a simple type otherwise null.

Parameters:
className - the class name of the simple type
Returns:
the simple type
Throws:
IllegalArgumentException - for a null className

compare

public int compare(Object first,
                   Object second)
Compare objects.

Parameters:
first - the first object
second - the second object
Returns:
compare result

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
Overrides:
isSimple in class AbstractMetaType
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
Overrides:
isPrimitive in class AbstractMetaType
Returns:

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

equalsIgnorePrimitive

public boolean equalsIgnorePrimitive(Object obj)
Returns:


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