|
JBoss Managed Parent POM 2.1.1.SP2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.metatype.api.values.MetaValueFactory
org.jboss.metatype.plugins.values.DefaultMetaValueFactory
public class DefaultMetaValueFactory
DefaultMetaValueFactory.
Constructor Summary | |
---|---|
DefaultMetaValueFactory()
|
Method Summary | ||
---|---|---|
protected org.jboss.reflect.spi.TypeInfo |
checkTypeInfo(org.jboss.reflect.spi.TypeInfo type,
Object value,
MetaType metaType)
Do a simple check. |
|
static Object[] |
convertPrimativeArray(Object value)
Transform a primitive array into an Object[]. |
|
static Object[] |
convertPrimativeArray(org.jboss.reflect.spi.TypeInfo type,
Object value)
Transform a primitive array into an Object[]. |
|
protected Object |
convertValue(Object value,
org.jboss.reflect.spi.TypeInfo typeInfo)
Convert the value. |
|
MetaValue |
create(Object value)
Create a meta value |
|
MetaValue |
create(Object value,
MetaType type)
Create a meta value given its MetaType |
|
MetaValue |
create(Object value,
Type type)
Create a meta value |
|
MetaValue |
create(Object value,
org.jboss.reflect.spi.TypeInfo type)
Create a meta value |
|
protected Object[] |
createArray(MetaType elementType,
Class<?> componentType,
int dimension,
Object[] oldArray)
Create an array |
|
ArrayValue |
createArrayValue(ArrayMetaType type,
Object value,
Map<Object,MetaValue> mapping)
Create an array value |
|
CollectionValue |
createCollectionValue(CollectionMetaType type,
Object value,
Map<Object,MetaValue> mapping)
Create a collection value |
|
CompositeValue |
createCompositeValue(CompositeMetaType type,
Object value,
Map<Object,MetaValue> mapping)
Create a composite value |
|
protected InvocationHandler |
createCompositeValueInvocationHandler(CompositeValue compositeValue)
Create composite invocation handler. |
|
static
|
createEnumValue(EnumMetaType type,
T value)
Create an enum value |
|
static GenericValue |
createGenericValue(GenericMetaType type,
Object value,
Map<Object,MetaValue> mapping)
Create a generic value |
|
protected Map<?,?> |
createMap(TableValue tableValue,
org.jboss.reflect.spi.TypeInfo keyType,
org.jboss.reflect.spi.TypeInfo valueType)
Create a map |
|
protected Object |
createNewInstance(org.jboss.beans.info.spi.BeanInfo beanInfo)
Create new instance. |
|
protected MetaValue |
createPropertiesValue(PropertiesMetaType metaType,
Object value,
Map<Object,MetaValue> mapping)
Create a PropertiesMetaValue |
|
static SimpleValue |
createSimpleValue(SimpleMetaType type,
Serializable value)
Create a simple value |
|
TableValue |
createTableValue(TableMetaType type,
Map value,
Map<Object,MetaValue> mapping)
Create a table value |
|
protected org.jboss.reflect.spi.TypeInfo |
getTypeInfo(MetaType metaType,
ClassLoader cl)
Get the class info from meta type. |
|
protected org.jboss.reflect.spi.TypeInfo |
getTypeInfo(MetaType metaType,
Object value)
Get the class info from meta type. |
|
protected Object |
getValue(MetaType metaType,
org.jboss.reflect.spi.TypeInfo typeInfo,
Object value)
Get the value. |
|
protected MetaValue |
internalCreate(Object value,
org.jboss.reflect.spi.TypeInfo type,
MetaType metaType)
Create a meta value from the object |
|
protected Object |
internalUnwrap(MetaValue metaValue,
org.jboss.reflect.spi.TypeInfo type)
Unwrap value from meta value. |
|
protected MetaValue |
isBuilder(MetaType metaType,
org.jboss.reflect.spi.TypeInfo type,
Object value,
Map<Object,MetaValue> mapping)
Check for a builder |
|
static Object |
mapNullToPrimitive(org.jboss.reflect.spi.TypeInfo type)
Map null to primitive. |
|
protected Object |
newArrayInstance(org.jboss.reflect.spi.TypeInfo typeInfo,
int size)
Get new array instance. |
|
void |
setBuilder(Class<?> clazz,
MetaValueBuilder<?> builder)
Set a meta value builder. |
|
|
setInstanceFactory(Class<T> clazz,
InstanceFactory<T> factory)
Set an instance factory. |
|
Object |
unwrap(MetaValue metaValue)
Unwrap meta value. |
|
Object |
unwrap(MetaValue metaValue,
Type type)
Unwrap meta value. |
|
Object |
unwrap(MetaValue metaValue,
org.jboss.reflect.spi.TypeInfo type)
Unwrap meta value. |
|
protected Object |
unwrapArray(Object array,
Object element)
Unwrap array. |
|
protected Object |
unwrapCollection(CollectionValue collectionValue,
org.jboss.reflect.spi.TypeInfo type)
Unwrap collection meta value. |
|
protected Object |
unwrapComposite(CompositeValue compositeValue,
org.jboss.reflect.spi.TypeInfo typeInfo)
Unwrap composite. |
|
protected Map |
unwrapCompositeMap(CompositeValue compositeValue)
|
|
protected Object |
unwrapMetaValue(MetaValue element,
org.jboss.reflect.spi.TypeInfo type,
Object array)
Unwrap MetaValue. |
|
protected Object |
unwrapProperties(PropertiesMetaValue propsValue,
org.jboss.reflect.spi.TypeInfo type)
|
|
protected Object |
unwrapTable(TableValue tableValue,
org.jboss.reflect.spi.TypeInfo type)
Unwrap table meta value. |
Methods inherited from class org.jboss.metatype.api.values.MetaValueFactory |
---|
getInstance |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultMetaValueFactory()
Method Detail |
---|
public void setBuilder(Class<?> clazz, MetaValueBuilder<?> builder)
MetaValueFactory
setBuilder
in class MetaValueFactory
clazz
- the classbuilder
- the builderpublic <T> void setInstanceFactory(Class<T> clazz, InstanceFactory<T> factory)
MetaValueFactory
setInstanceFactory
in class MetaValueFactory
T
- exact instance typeclazz
- the classfactory
- the factorypublic static SimpleValue createSimpleValue(SimpleMetaType type, Serializable value)
type
- the typevalue
- the value
public static <T extends Enum<?>> EnumValue createEnumValue(EnumMetaType type, T value)
T
- the enum typetype
- the typevalue
- the value
public static GenericValue createGenericValue(GenericMetaType type, Object value, Map<Object,MetaValue> mapping)
type
- the typevalue
- the valuemapping
- the mapping
public CollectionValue createCollectionValue(CollectionMetaType type, Object value, Map<Object,MetaValue> mapping)
type
- the typevalue
- the valuemapping
- the mapping
public static Object[] convertPrimativeArray(org.jboss.reflect.spi.TypeInfo type, Object value)
type
- - the primitive array class type info.value
- - the primitive array instance.
public static Object mapNullToPrimitive(org.jboss.reflect.spi.TypeInfo type)
type
- the type info
public static Object[] convertPrimativeArray(Object value)
value
- - the primitive array instance.
public ArrayValue createArrayValue(ArrayMetaType type, Object value, Map<Object,MetaValue> mapping)
type
- the typevalue
- the valuemapping
- the mapping
protected Object[] createArray(MetaType elementType, Class<?> componentType, int dimension, Object[] oldArray)
elementType
- the element typecomponentType
- the component typedimension
- the dimensionoldArray
- the old array
public CompositeValue createCompositeValue(CompositeMetaType type, Object value, Map<Object,MetaValue> mapping)
type
- the typevalue
- the valuemapping
- the mapping
public TableValue createTableValue(TableMetaType type, Map value, Map<Object,MetaValue> mapping)
type
- the typevalue
- the valuemapping
- the mapping
public MetaValue create(Object value)
MetaValueFactory
create
in class MetaValueFactory
value
- the value
public MetaValue create(Object value, Type type)
MetaValueFactory
create
in class MetaValueFactory
value
- the valuetype
- the type
public MetaValue create(Object value, org.jboss.reflect.spi.TypeInfo type)
MetaValueFactory
create
in class MetaValueFactory
value
- the valuetype
- the type
public MetaValue create(Object value, MetaType type)
MetaValueFactory
create
in class MetaValueFactory
type
- the meta type
public Object unwrap(MetaValue metaValue)
MetaValueFactory
unwrap
in class MetaValueFactory
metaValue
- meta value
public Object unwrap(MetaValue metaValue, Type type)
MetaValueFactory
unwrap
in class MetaValueFactory
metaValue
- meta valuetype
- the type
public Object unwrap(MetaValue metaValue, org.jboss.reflect.spi.TypeInfo type)
MetaValueFactory
unwrap
in class MetaValueFactory
metaValue
- meta valuetype
- the type
protected Object internalUnwrap(MetaValue metaValue, org.jboss.reflect.spi.TypeInfo type)
metaValue
- the meta valuetype
- expected type info
protected org.jboss.reflect.spi.TypeInfo checkTypeInfo(org.jboss.reflect.spi.TypeInfo type, Object value, MetaType metaType)
type
- the type infovalue
- tester valuemetaType
- the meta type
protected Object getValue(MetaType metaType, org.jboss.reflect.spi.TypeInfo typeInfo, Object value)
metaType
- the meta typetypeInfo
- the type infovalue
- the value
protected Object unwrapMetaValue(MetaValue element, org.jboss.reflect.spi.TypeInfo type, Object array)
element
- the meta valuetype
- parent typearray
- parent array
protected Object unwrapArray(Object array, Object element)
array
- parent arrayelement
- current array element
protected Object unwrapProperties(PropertiesMetaValue propsValue, org.jboss.reflect.spi.TypeInfo type)
protected Object unwrapComposite(CompositeValue compositeValue, org.jboss.reflect.spi.TypeInfo typeInfo)
compositeValue
- the composite valuetypeInfo
- expected type info
protected Map unwrapCompositeMap(CompositeValue compositeValue)
protected InvocationHandler createCompositeValueInvocationHandler(CompositeValue compositeValue)
compositeValue
- the composite value
protected Object unwrapCollection(CollectionValue collectionValue, org.jboss.reflect.spi.TypeInfo type)
collectionValue
- the collection valuetype
- the type info
protected Object unwrapTable(TableValue tableValue, org.jboss.reflect.spi.TypeInfo type)
tableValue
- the table valuetype
- the type info
protected Map<?,?> createMap(TableValue tableValue, org.jboss.reflect.spi.TypeInfo keyType, org.jboss.reflect.spi.TypeInfo valueType)
tableValue
- the table valuekeyType
- the key typevalueType
- the value type
protected MetaValue createPropertiesValue(PropertiesMetaType metaType, Object value, Map<Object,MetaValue> mapping)
metaType
- value
- mapping
-
protected Object createNewInstance(org.jboss.beans.info.spi.BeanInfo beanInfo) throws Throwable
beanInfo
- the bean info
Throwable
- for any errorprotected Object newArrayInstance(org.jboss.reflect.spi.TypeInfo typeInfo, int size)
typeInfo
- the type infosize
- the size
protected org.jboss.reflect.spi.TypeInfo getTypeInfo(MetaType metaType, Object value)
metaType
- the meta typevalue
- the value which can provide classloader
protected org.jboss.reflect.spi.TypeInfo getTypeInfo(MetaType metaType, ClassLoader cl)
metaType
- the meta typecl
- the classloader
protected MetaValue internalCreate(Object value, org.jboss.reflect.spi.TypeInfo type, MetaType metaType)
value
- the valuetype
- the typemetaType
- the metaType
protected Object convertValue(Object value, org.jboss.reflect.spi.TypeInfo typeInfo)
value
- the valuetypeInfo
- type info
UndeclaredThrowableException
- for any errorprotected MetaValue isBuilder(MetaType metaType, org.jboss.reflect.spi.TypeInfo type, Object value, Map<Object,MetaValue> mapping)
metaType
- the meta typetype
- the typevalue
- the valuemapping
- the mappings
|
JBoss Managed Parent POM 2.1.1.SP2 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |