net.sf.omap
Class AbstractMappingExpert

java.lang.Object
  extended bynet.sf.omap.AbstractMappingExpert
All Implemented Interfaces:
MappingExpert
Direct Known Subclasses:
ObjectToObjectMappingExpert, ObjectToXMLMappingExpert

public abstract class AbstractMappingExpert
extends java.lang.Object
implements MappingExpert


Constructor Summary
AbstractMappingExpert()
           
 
Method Summary
 java.lang.Object map(java.lang.String category, java.lang.Object o)
          Maps the given object using the registered mapper for the object's class in the given category If the given category doesn't contain a mapper for the object's class, tries to find one in the default category.
 void register(java.lang.Class type, ObjectMapper mapper)
          Registers the mapper for the given class (type) in the default mapper category.
 void register(java.lang.String definition)
          Registers all the mappers defined by the given definition in the default mapper category
 void register(java.lang.String category, java.lang.Class type, ObjectMapper mapper)
          Registers the mapper for the given class (type) in the given mapper category.
 void register(java.lang.String category, java.lang.String definition)
          Registers the mappers define by the given definition in the given category
 void setMapperCreator(MapperCreator creator)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface net.sf.omap.MappingExpert
map, register, register
 

Constructor Detail

AbstractMappingExpert

public AbstractMappingExpert()
Method Detail

setMapperCreator

public void setMapperCreator(MapperCreator creator)

register

public void register(java.lang.String definition)
Description copied from interface: MappingExpert
Registers all the mappers defined by the given definition in the default mapper category

Specified by:
register in interface MappingExpert
Parameters:
definition - the mappers definition

register

public void register(java.lang.Class type,
                     ObjectMapper mapper)
Description copied from interface: MappingExpert
Registers the mapper for the given class (type) in the default mapper category.

Specified by:
register in interface MappingExpert
Parameters:
type - the class to register with the mapper
mapper - the mapper to register

register

public void register(java.lang.String category,
                     java.lang.String definition)
Description copied from interface: MappingExpert
Registers the mappers define by the given definition in the given category

Specified by:
register in interface MappingExpert
Parameters:
category - the category in which to register the mapper
definition - the mapper definition

register

public void register(java.lang.String category,
                     java.lang.Class type,
                     ObjectMapper mapper)
Description copied from interface: MappingExpert
Registers the mapper for the given class (type) in the given mapper category.

Specified by:
register in interface MappingExpert
Parameters:
category - the category in which to register the mapper
type - the class to register with the mapper
mapper - the mapper to register

map

public java.lang.Object map(java.lang.String category,
                            java.lang.Object o)
Description copied from interface: MappingExpert
Maps the given object using the registered mapper for the object's class in the given category

If the given category doesn't contain a mapper for the object's class, tries to find one in the default category. If no default mapper is found the returned value depends on the expert implementation (could be null, an empty string, etc.)

Specified by:
map in interface MappingExpert
Parameters:
category - the category in which to search for the registered mapper
o - the object to map
Returns:
the mapped object