|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TypeInfo
A type info
| Method Summary | ||
|---|---|---|
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 |
|
TypeInfo |
getArrayType()
Get an array type |
|
|
getAttachment(Class<T> expectedType)
Get an attachment from the type, uses the expected type as both the name and to cast the resulting object. |
|
Object |
getAttachment(String name)
Get an attachment from the type |
|
String |
getName()
Get the type name |
|
String |
getSimpleName()
Get the simple name |
|
Class<?> |
getType()
Deprecated. I'm not sure this should be here? |
|
TypeInfoFactory |
getTypeInfoFactory()
Get the TypeInfoFactory that created this type info |
|
boolean |
isAnnotation()
Whether this type is an annotation |
|
boolean |
isArray()
Whether this type is an array |
|
boolean |
isAssignableFrom(TypeInfo info)
Mostly using |
|
boolean |
isCollection()
Whether this type is a collection |
|
boolean |
isEnum()
Whether this type is an enum |
|
boolean |
isMap()
Whether this type is a map |
|
boolean |
isPrimitive()
Whether this type is a primitive |
|
Object |
newArrayInstance(int size)
Create a new array |
|
void |
setAttachment(String name,
Object attachment)
Set an attachment against the type. |
|
| Method Detail |
|---|
String getName()
String getSimpleName()
Class<?> getType()
Object convertValue(Object value)
throws Throwable
value - the original value
Throwable - for any error
Object convertValue(Object value,
boolean replaceProperties)
throws Throwable
value - the original valuereplaceProperties - whether to replace properties
Throwable - for any error
Object convertValue(Object value,
boolean replaceProperties,
boolean trim)
throws Throwable
value - the original valuereplaceProperties - whether to replace propertiestrim - do we trim before conversion
Throwable - for any errorboolean isArray()
boolean isCollection()
boolean isMap()
boolean isAnnotation()
boolean isEnum()
boolean isPrimitive()
TypeInfo getArrayType()
Object newArrayInstance(int size)
throws Throwable
size - the size
Throwable - for any errorboolean isAssignableFrom(TypeInfo info)
info - type info
NullPointerException - if the specified TypeInfo parameter is
null.NumberInfo tests for progressionTypeInfoFactory getTypeInfoFactory()
Object getAttachment(String name)
name - the name
<T> T getAttachment(Class<T> expectedType)
T - the expected typeexpectedType - the expected type
ClassCastException - when the object is not of the expected type
void setAttachment(String name,
Object attachment)
If you add a future object, subsequent gets will wait for the result
WARNING: Be careful about what you put in here. Don't create references across classloaders, if you are not sure add a WeakReference to the information.
name - the nameattachment - the attachment, pass null to remove an attachment
IllegalArgumentException - for a null name
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||