public class PrimitiveInfo extends AbstractTypeInfo
Modifier and Type | Field and Description |
---|---|
static PrimitiveInfo |
BOOLEAN
The boolean info
|
static PrimitiveInfo |
BYTE
The byte info
|
static PrimitiveInfo |
CHAR
The char info
|
static PrimitiveInfo |
DOUBLE
The double info
|
static PrimitiveInfo |
FLOAT
The float info
|
static PrimitiveInfo |
INT
The int info
|
static PrimitiveInfo |
LONG
The long info
|
protected String |
name
The name
|
protected int |
ordinal
The ordinal
|
static PrimitiveInfo |
SHORT
The short info
|
protected Class<? extends Object> |
type
The type
|
protected static TypeInfoFactory |
typeInfoFactory
The type info factory
|
static PrimitiveInfo |
VOID
The void info
|
Modifier | Constructor and Description |
---|---|
protected |
PrimitiveInfo(String name,
int ordinal,
Class<? extends Object> type)
Create a new primitive info
|
Modifier and Type | Method and Description |
---|---|
protected boolean |
canProgress(Class<?> clazz)
Can we progress class param to this type info.
|
Object |
convertValue(Object value)
Convert a value
|
Object |
convertValue(Object value,
boolean replaceProperties)
Convert a value
|
Object |
convertValue(Object value,
boolean replaceProperties,
boolean trim)
Convert a value
|
boolean |
equals(Object obj) |
TypeInfo |
getArrayType()
Get an array type
|
String |
getName()
Get the type name
|
static Class<?> |
getPrimativeArrayComponentType(String name)
Get the primtive array type class map for a name
|
static String |
getPrimativeArrayType(String name)
Get a primtive array type
|
static Class<?> |
getPrimativeType(String name)
Get the primtive type for a name
|
String |
getSimpleName()
Get the simple name
|
Class<?> |
getType()
Deprecated.
|
TypeInfoFactory |
getTypeInfoFactory()
Get the TypeInfoFactory that created this type info
|
int |
hashCode() |
boolean |
isAssignableFrom(TypeInfo info)
Mostly using
|
boolean |
isInstance(Object object)
Is object instance of this type info.
|
boolean |
isPrimitive()
Whether this type is a primitive
|
Object |
newArrayInstance(int size)
Create a new array
|
int |
ordinal()
Get the ordinal
|
String |
toShortString() |
String |
toString() |
static PrimitiveInfo |
valueOf(String name)
Get the primitive info for a type
|
getAttachment, getAttachment, isAnnotation, isArray, isCollection, isEnum, isMap, setAttachment
public static final PrimitiveInfo BOOLEAN
public static final PrimitiveInfo BYTE
public static final PrimitiveInfo CHAR
public static final PrimitiveInfo DOUBLE
public static final PrimitiveInfo FLOAT
public static final PrimitiveInfo INT
public static final PrimitiveInfo LONG
public static final PrimitiveInfo SHORT
public static final PrimitiveInfo VOID
protected static final TypeInfoFactory typeInfoFactory
protected final transient String name
protected final int ordinal
public static PrimitiveInfo valueOf(String name)
name
- the namepublic static String getPrimativeArrayType(String name)
name
- the primtive type namepublic static Class<?> getPrimativeType(String name)
name
- the primtive type namepublic static Class<?> getPrimativeArrayComponentType(String name)
name
- the array type namepublic int ordinal()
public String getName()
TypeInfo
public String getSimpleName()
TypeInfo
@Deprecated public Class<?> getType()
TypeInfo
public Object convertValue(Object value) throws Throwable
TypeInfo
value
- the original valueThrowable
- for any errorpublic Object convertValue(Object value, boolean replaceProperties) throws Throwable
TypeInfo
value
- the original valuereplaceProperties
- whether to replace propertiesThrowable
- for any errorpublic Object convertValue(Object value, boolean replaceProperties, boolean trim) throws Throwable
TypeInfo
value
- the original valuereplaceProperties
- whether to replace propertiestrim
- do we trim before conversionThrowable
- for any errorpublic boolean isPrimitive()
TypeInfo
isPrimitive
in interface TypeInfo
isPrimitive
in class AbstractTypeInfo
public TypeInfo getArrayType()
TypeInfo
public Object newArrayInstance(int size) throws Throwable
TypeInfo
size
- the sizeThrowable
- for any errorpublic boolean isAssignableFrom(TypeInfo info)
TypeInfo
info
- type infoPrimitiveInfo tests for progression
public boolean isInstance(Object object)
TypeInfo
object
- the object to checkobject
is an instance of this classPrimitiveInfo tests for progression
protected boolean canProgress(Class<?> clazz)
clazz
- the class to progresspublic TypeInfoFactory getTypeInfoFactory()
TypeInfo
public String toString()
toString
in class org.jboss.util.JBossObject
public String toShortString()
toShortString
in interface org.jboss.util.JBossInterface
toShortString
in class org.jboss.util.JBossObject
public int hashCode()
hashCode
in class org.jboss.util.JBossObject
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.