net.sf.omap
Interface MappingExpert

All Known Implementing Classes:
AbstractMappingExpert

public interface MappingExpert


Method Summary
 java.lang.Object map(java.lang.Object o)
          Maps the given object using the registered mapper for the object's class in default category If no mapper is found to map the given object returns null
 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.Class type, java.lang.String definition)
          Registers the mapper definition for the given 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.Class type, java.lang.String definition)
          Registers the mapper definition for the given type in the given category
 void register(java.lang.String category, java.lang.String definition)
          Registers the mappers define by the given definition in the given category
 

Method Detail

map

public java.lang.Object map(java.lang.Object o)
Maps the given object using the registered mapper for the object's class in default category

If no mapper is found to map the given object returns null

Parameters:
o - the object to map
Returns:
the mapped object or null if no mapper was found

map

public 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. If no default mapper is found the returned value depends on the expert implementation (could be null, an empty string, etc.)

Parameters:
category - the category in which to search for the registered mapper
o - the object to map
Returns:
the mapped object
Throws:
MappingException - if the category does not exist

register

public void register(java.lang.String definition)
Registers all the mappers defined by the given definition in the default mapper category

Parameters:
definition - the mappers definition

register

public void register(java.lang.Class type,
                     ObjectMapper mapper)
Registers the mapper for the given class (type) in the default mapper category.

Parameters:
type - the class to register with the mapper
mapper - the mapper to register

register

public void register(java.lang.Class type,
                     java.lang.String definition)
Registers the mapper definition for the given type in the default mapper category

Parameters:
type - the class to register with the mapper
definition - the mapper definition

register

public void register(java.lang.String category,
                     java.lang.String definition)
Registers the mappers define by the given definition in the given category

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)
Registers the mapper for the given class (type) in the given mapper category.

Parameters:
category - the category in which to register the mapper
type - the class to register with the mapper
mapper - the mapper to register

register

public void register(java.lang.String category,
                     java.lang.Class type,
                     java.lang.String definition)
Registers the mapper definition for the given type in the given category

Parameters:
category - the category in which to register the mapper
type - the class to register with the mapper
definition - the mapper definition