public abstract class AbstractTypeInfo extends org.jboss.util.JBossObject implements TypeInfo
Constructor and Description |
---|
AbstractTypeInfo() |
Modifier and Type | Method and Description |
---|---|
<T> T |
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
|
boolean |
isAnnotation()
Whether this type is an annotation
|
boolean |
isArray()
Whether this type is an array
|
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
|
void |
setAttachment(String name,
Object attachment)
Set an attachment against the type.
|
cacheGetHashCode, cacheToString, clone, equals, flushJBossObjectCache, getClassShortName, getHashCode, hashCode, list, notEqual, toShortString, toShortString, toString, toString, toStringImplementation
equals, finalize, getClass, notify, notifyAll, wait, wait, wait
convertValue, convertValue, convertValue, getArrayType, getName, getSimpleName, getType, getTypeInfoFactory, isAssignableFrom, isInstance, newArrayInstance
public boolean isArray()
TypeInfo
public boolean isCollection()
TypeInfo
isCollection
in interface TypeInfo
public boolean isMap()
TypeInfo
public boolean isAnnotation()
TypeInfo
isAnnotation
in interface TypeInfo
public boolean isEnum()
TypeInfo
public boolean isPrimitive()
TypeInfo
isPrimitive
in interface TypeInfo
public void setAttachment(String name, Object attachment)
TypeInfo
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.
setAttachment
in interface TypeInfo
name
- the nameattachment
- the attachment, pass null to remove an attachmentpublic <T> T getAttachment(Class<T> expectedType)
TypeInfo
getAttachment
in interface TypeInfo
T
- the expected typeexpectedType
- the expected typepublic Object getAttachment(String name)
TypeInfo
getAttachment
in interface TypeInfo
name
- the nameCopyright © 2016 JBoss by Red Hat. All rights reserved.