org.jboss.metatype.spi.values
Class MetaMapper<T>

java.lang.Object
  extended by org.jboss.metatype.spi.values.MetaMapper<T>
Type Parameters:
T - the mapped type
Direct Known Subclasses:
ObjectNameMetaMapper, PropertiesCompositeObjectNameMetaMapper, PropertiesMetaMapper, PropertiesObjectNameMetaMapper, StringObjectNameMetaMapper

public abstract class MetaMapper<T>
extends Object

MetaMapper.

Version:
$Revision: 1.1 $
Author:
Adrian Brock

Constructor Summary
MetaMapper()
           
 
Method Summary
abstract  MetaValue createMetaValue(MetaType metaType, T object)
          Create the meta value
static MetaMapper<?> getMetaMapper(org.jboss.reflect.spi.TypeInfo typeInfo)
          Get a metamapper for a type info
 MetaType getMetaType()
          Override this method to create your own metatype
 Type mapToType()
          Override this method to map to a specific type
abstract  T unwrapMetaValue(MetaValue metaValue)
          Unwrap the metavalue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaMapper

public MetaMapper()
Method Detail

getMetaMapper

public static final MetaMapper<?> getMetaMapper(org.jboss.reflect.spi.TypeInfo typeInfo)
Get a metamapper for a type info

Parameters:
typeInfo - the type info
Returns:
the metamapper or null if there isn't one

mapToType

public Type mapToType()
Override this method to map to a specific type

Returns:
the type

getMetaType

public MetaType getMetaType()
Override this method to create your own metatype

Returns:
the metatype

createMetaValue

public abstract MetaValue createMetaValue(MetaType metaType,
                                          T object)
Create the meta value

Parameters:
metaType - the metatype
object - the object
Returns:
the meta value

unwrapMetaValue

public abstract T unwrapMetaValue(MetaValue metaValue)
Unwrap the metavalue

Parameters:
metaValue - the meta value
Returns:
the object


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