net.sf.omap
Interface ObjectMapper

All Known Implementing Classes:
AbstractObjectMapper

public interface ObjectMapper


Method Summary
 MappingDefinition getDefinition()
          Returns the mapper definition (the mapping metadata)
 java.lang.Object map(java.lang.Object o)
          Maps the given object.
 java.lang.Object map(java.lang.String category, java.lang.Object o)
          Maps the given object.
 

Method Detail

map

public java.lang.Object map(java.lang.Object o)
Maps the given object.

If the mapper needs to find another mapper, it will search a mapper that belongs to the default category

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.

If the mapper needs to find another mapper, it will search a mapper that belongs to the given category

Parameters:
category - the category in which to search for the registered mappers
o - the object to map
Returns:
the mapped object
Throws:
MappingException - if no mapper is not found

getDefinition

public MappingDefinition getDefinition()
Returns the mapper definition (the mapping metadata)

Returns:
a MappingDefinition object