org.jboss.reflect.spi
Class NumberInfo

java.lang.Object
  extended by org.jboss.util.JBossObject
      extended by org.jboss.reflect.spi.AbstractTypeInfo
          extended by org.jboss.reflect.spi.PrimitiveInfo
              extended by org.jboss.reflect.spi.NumberInfo
All Implemented Interfaces:
Serializable, Cloneable, AnnotatedInfo, ClassInfo, ModifierInfo, TypeInfo, org.jboss.util.JBossInterface

public class NumberInfo
extends PrimitiveInfo
implements ClassInfo

Number info

Author:
Ales Justin
See Also:
Serialized Form

Nested Class Summary
static class NumberInfo.Phase
          The phase enum
 
Field Summary
static NumberInfo ATOMIC_INT
          The atomic int info
static NumberInfo ATOMIC_LONG
          The atomic long info
static NumberInfo BYTE_OBJECT
          The byte info
static NumberInfo DOUBLE_OBJECT
          The double info
static NumberInfo FLOAT_OBJECT
          The float info
static NumberInfo INT_OBJECT
          The int info
static NumberInfo LONG_OBJECT
          The long info
static NumberInfo SHORT_OBJECT
          The short info
 
Fields inherited from class org.jboss.reflect.spi.PrimitiveInfo
BOOLEAN, BYTE, CHAR, DOUBLE, FLOAT, INT, LONG, name, ordinal, SHORT, type, typeInfoFactory, VOID
 
Fields inherited from class org.jboss.util.JBossObject
hashCode, log, toString
 
Fields inherited from interface org.jboss.reflect.spi.ModifierInfo
ABSTRACT, CONSTANT, FINAL, PACKAGE, PACKAGE_ABSTRACT, PACKAGE_CONSTANT, PACKAGE_STATIC, PRIVATE, PRIVATE_CONSTANT, PRIVATE_STATIC, PROTECTED, PROTECTED_ABSTRACT, PROTECTED_CONSTANT, PROTECTED_STATIC, PUBLIC, PUBLIC_ABSTRACT, PUBLIC_CONSTANT, PUBLIC_STATIC, STATIC
 
Constructor Summary
protected NumberInfo(int ordinal, Class<? extends Object> type)
          Create a new number info
 
Method Summary
 Object clone()
           
 boolean equals(Object obj)
           
 TypeInfo[] getActualTypeArguments()
          Get the actual type parameters
 AnnotationValue getAnnotation(String name)
          Get an annotation
 AnnotationValue[] getAnnotations()
          Get the annotations
 TypeInfo getComponentType()
          Get the component type if it is a collection or an array
 ConstructorInfo getDeclaredConstructor(TypeInfo[] parameters)
          Get a declared constructor
 ConstructorInfo[] getDeclaredConstructors()
          Get the declared constructors
 FieldInfo getDeclaredField(String name)
          Get the declared field
 FieldInfo[] getDeclaredFields()
          Get the declared fields
 MethodInfo getDeclaredMethod(String name, TypeInfo[] parameters)
          Get the declared method
 MethodInfo[] getDeclaredMethods()
          Get the declared methods
 InterfaceInfo[] getGenericInterfaces()
          Get the generic interfaces
 ClassInfo getGenericSuperclass()
          Get the generic super class
 InterfaceInfo[] getInterfaces()
          Get the interfaces
 TypeInfo getKeyType()
          Get the key type if it is a map
 int getModifiers()
          Get the modifiers
 TypeInfo getOwnerType()
          Get the owner type
 PackageInfo getPackage()
          Get the package
 NumberInfo.Phase getPhase()
          Get the phase.
 ClassInfo getRawType()
          Get the raw type
 ClassInfo getSuperclass()
          Get the super class
<T extends Annotation>
T
getUnderlyingAnnotation(Class<T> annotationType)
          Get an underlying annotation
 Annotation[] getUnderlyingAnnotations()
          Get the underlying annotations
 TypeInfo getValueType()
          Get the value type if it is a map
 void initializing()
          Are we currently initializing delegate.
 boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
          Test whether an annotation is present
 boolean isAnnotationPresent(String name)
          Test whether an annotation is present
 boolean isInterface()
          Whether it is an interface
 boolean isPrimitive()
          Whether this type is a primitive
 boolean isPublic()
          Whether it is public
 boolean isStatic()
          Whether it is static
 boolean isVolatile()
          Whether it is volatile
 void setDelegate(TypeInfo info)
          Set the delegate
 void toShortString(org.jboss.util.JBossStringBuilder buffer)
           
protected  void toString(org.jboss.util.JBossStringBuilder buffer)
           
static NumberInfo valueOf(String name)
          Get the primitive info for a type
 
Methods inherited from class org.jboss.reflect.spi.PrimitiveInfo
canProgress, convertValue, convertValue, convertValue, getArrayType, getName, getPrimativeArrayComponentType, getPrimativeArrayType, getPrimativeType, getSimpleName, getType, getTypeInfoFactory, hashCode, isAssignableFrom, isInstance, newArrayInstance, ordinal, toShortString, toString
 
Methods inherited from class org.jboss.reflect.spi.AbstractTypeInfo
getAttachment, getAttachment, isAnnotation, isArray, isCollection, isEnum, isMap, setAttachment
 
Methods inherited from class org.jboss.util.JBossObject
cacheGetHashCode, cacheToString, equals, flushJBossObjectCache, getClassShortName, getHashCode, list, notEqual, toStringImplementation
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.jboss.reflect.spi.ClassInfo
getName
 
Methods inherited from interface org.jboss.util.JBossInterface
toShortString
 
Methods inherited from interface org.jboss.reflect.spi.TypeInfo
convertValue, convertValue, convertValue, getArrayType, getAttachment, getAttachment, getSimpleName, getType, getTypeInfoFactory, isAnnotation, isArray, isAssignableFrom, isCollection, isEnum, isInstance, isMap, newArrayInstance, setAttachment
 

Field Detail

BYTE_OBJECT

public static final NumberInfo BYTE_OBJECT
The byte info


DOUBLE_OBJECT

public static final NumberInfo DOUBLE_OBJECT
The double info


FLOAT_OBJECT

public static final NumberInfo FLOAT_OBJECT
The float info


INT_OBJECT

public static final NumberInfo INT_OBJECT
The int info


LONG_OBJECT

public static final NumberInfo LONG_OBJECT
The long info


SHORT_OBJECT

public static final NumberInfo SHORT_OBJECT
The short info


ATOMIC_INT

public static final NumberInfo ATOMIC_INT
The atomic int info


ATOMIC_LONG

public static final NumberInfo ATOMIC_LONG
The atomic long info

Constructor Detail

NumberInfo

protected NumberInfo(int ordinal,
                     Class<? extends Object> type)
Create a new number info

Parameters:
ordinal - the oridinal
type - the class
Method Detail

valueOf

public static NumberInfo valueOf(String name)
Get the primitive info for a type

Parameters:
name - the name
Returns:
the info

setDelegate

public void setDelegate(TypeInfo info)
Set the delegate

Parameters:
info - the delegate info
Throws:
IllegalArgumentException - if the delegate is null or not a class info

getPhase

public NumberInfo.Phase getPhase()
Get the phase.

Returns:
the current phase

initializing

public void initializing()
Are we currently initializing delegate.


equals

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

getDeclaredConstructor

public ConstructorInfo getDeclaredConstructor(TypeInfo[] parameters)
Description copied from interface: ClassInfo
Get a declared constructor

Specified by:
getDeclaredConstructor in interface ClassInfo
Parameters:
parameters - the parameters
Returns:
the constructor

getDeclaredConstructors

public ConstructorInfo[] getDeclaredConstructors()
Description copied from interface: ClassInfo
Get the declared constructors

Specified by:
getDeclaredConstructors in interface ClassInfo
Returns:
the constructors

getDeclaredField

public FieldInfo getDeclaredField(String name)
Description copied from interface: ClassInfo
Get the declared field

Specified by:
getDeclaredField in interface ClassInfo
Parameters:
name - the field name
Returns:
the field

getDeclaredFields

public FieldInfo[] getDeclaredFields()
Description copied from interface: ClassInfo
Get the declared fields

Specified by:
getDeclaredFields in interface ClassInfo
Returns:
the fields

getDeclaredMethod

public MethodInfo getDeclaredMethod(String name,
                                    TypeInfo[] parameters)
Description copied from interface: ClassInfo
Get the declared method

Specified by:
getDeclaredMethod in interface ClassInfo
Parameters:
name - the method name
parameters - the parameters
Returns:
the method info

getDeclaredMethods

public MethodInfo[] getDeclaredMethods()
Description copied from interface: ClassInfo
Get the declared methods

Specified by:
getDeclaredMethods in interface ClassInfo
Returns:
the methods

getGenericInterfaces

public InterfaceInfo[] getGenericInterfaces()
Description copied from interface: ClassInfo
Get the generic interfaces

Specified by:
getGenericInterfaces in interface ClassInfo
Returns:
the generic interfaces

getGenericSuperclass

public ClassInfo getGenericSuperclass()
Description copied from interface: ClassInfo
Get the generic super class

Specified by:
getGenericSuperclass in interface ClassInfo
Returns:
the super class

getInterfaces

public InterfaceInfo[] getInterfaces()
Description copied from interface: ClassInfo
Get the interfaces

Specified by:
getInterfaces in interface ClassInfo
Returns:
the interfaces

getSuperclass

public ClassInfo getSuperclass()
Description copied from interface: ClassInfo
Get the super class

Specified by:
getSuperclass in interface ClassInfo
Returns:
the super class

isInterface

public boolean isInterface()
Description copied from interface: ClassInfo
Whether it is an interface

Specified by:
isInterface in interface ClassInfo
Returns:
true when an interface

getAnnotation

public AnnotationValue getAnnotation(String name)
Description copied from interface: AnnotatedInfo
Get an annotation

Specified by:
getAnnotation in interface AnnotatedInfo
Parameters:
name - the name
Returns:
the annotation

getAnnotations

public AnnotationValue[] getAnnotations()
Description copied from interface: AnnotatedInfo
Get the annotations

Specified by:
getAnnotations in interface AnnotatedInfo
Returns:
the annotations

isAnnotationPresent

public boolean isAnnotationPresent(String name)
Description copied from interface: AnnotatedInfo
Test whether an annotation is present

Specified by:
isAnnotationPresent in interface AnnotatedInfo
Parameters:
name - the name
Returns:
true when the annotation is present

getUnderlyingAnnotation

public <T extends Annotation> T getUnderlyingAnnotation(Class<T> annotationType)
Description copied from interface: AnnotatedInfo
Get an underlying annotation

Specified by:
getUnderlyingAnnotation in interface AnnotatedInfo
Type Parameters:
T - the annotation type
Parameters:
annotationType - the annotationType
Returns:
the annotation

getUnderlyingAnnotations

public Annotation[] getUnderlyingAnnotations()
Description copied from interface: AnnotatedInfo
Get the underlying annotations

Specified by:
getUnderlyingAnnotations in interface AnnotatedInfo
Returns:
the annotations

isAnnotationPresent

public boolean isAnnotationPresent(Class<? extends Annotation> annotationType)
Description copied from interface: AnnotatedInfo
Test whether an annotation is present

Specified by:
isAnnotationPresent in interface AnnotatedInfo
Returns:
true when the annotation is present

getModifiers

public int getModifiers()
Description copied from interface: ModifierInfo
Get the modifiers

Specified by:
getModifiers in interface ModifierInfo
Returns:
the modifiers

isPublic

public boolean isPublic()
Description copied from interface: ModifierInfo
Whether it is public

Specified by:
isPublic in interface ModifierInfo
Returns:
true when public

isStatic

public boolean isStatic()
Description copied from interface: ModifierInfo
Whether it is static

Specified by:
isStatic in interface ModifierInfo
Returns:
true when static

isVolatile

public boolean isVolatile()
Description copied from interface: ModifierInfo
Whether it is volatile

Specified by:
isVolatile in interface ModifierInfo
Returns:
true if volatile

isPrimitive

public boolean isPrimitive()
Description copied from interface: TypeInfo
Whether this type is a primitive

Specified by:
isPrimitive in interface TypeInfo
Overrides:
isPrimitive in class PrimitiveInfo
Returns:
true when a primtive

getActualTypeArguments

public TypeInfo[] getActualTypeArguments()
Description copied from interface: ClassInfo
Get the actual type parameters

Specified by:
getActualTypeArguments in interface ClassInfo
Returns:
the type parameters

getOwnerType

public TypeInfo getOwnerType()
Description copied from interface: ClassInfo
Get the owner type

Specified by:
getOwnerType in interface ClassInfo
Returns:
the owner type

getRawType

public ClassInfo getRawType()
Description copied from interface: ClassInfo
Get the raw type

Specified by:
getRawType in interface ClassInfo
Returns:
the raw type

getComponentType

public TypeInfo getComponentType()
Description copied from interface: ClassInfo
Get the component type if it is a collection or an array

Specified by:
getComponentType in interface ClassInfo
Returns:
the component type

getKeyType

public TypeInfo getKeyType()
Description copied from interface: ClassInfo
Get the key type if it is a map

Specified by:
getKeyType in interface ClassInfo
Returns:
the key type

getValueType

public TypeInfo getValueType()
Description copied from interface: ClassInfo
Get the value type if it is a map

Specified by:
getValueType in interface ClassInfo
Returns:
the value type

getPackage

public PackageInfo getPackage()
Description copied from interface: ClassInfo
Get the package

Specified by:
getPackage in interface ClassInfo
Returns:
the package

clone

public Object clone()
Specified by:
clone in interface org.jboss.util.JBossInterface
Overrides:
clone in class org.jboss.util.JBossObject

toShortString

public void toShortString(org.jboss.util.JBossStringBuilder buffer)
Specified by:
toShortString in interface org.jboss.util.JBossInterface
Overrides:
toShortString in class org.jboss.util.JBossObject

toString

protected void toString(org.jboss.util.JBossStringBuilder buffer)
Overrides:
toString in class org.jboss.util.JBossObject


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