de.bea.domingo.map
Class DirectMapper

java.lang.Object
  extended by de.bea.domingo.map.BaseDMapper
      extended by de.bea.domingo.map.DirectMapper
All Implemented Interfaces:
Mapper

public final class DirectMapper
extends BaseDMapper

Class defining and performing a direct mapping of a single attribute between a document and a business object. The following types are supported:

Other types must be mapped e.g. with a CustomMapper.

Author:
Kurt Riede

Constructor Summary
DirectMapper(java.lang.String itemName, java.lang.Class clazz)
          Constructor.
DirectMapper(java.lang.String itemName, java.lang.String attributeName, java.lang.Class clazz)
          Constructor.
DirectMapper(java.lang.String itemName, java.lang.String getName, java.lang.String setName, java.lang.Class clazz)
          Constructor.
 
Method Summary
 void map(DDocument document, java.lang.Object object)
          Performs the direct mapping from a document to a business object.
 void map(java.lang.Object object, DDocument document)
          Performs the direct mapping from a business object to a document.
 
Methods inherited from class de.bea.domingo.map.BaseDMapper
getCalendar, getValue, getValue, getValueDate, getValueDateRange, getValueDouble, getValueInteger, getValueString, hasMethod, replaceItemValue, replaceItemValue, replaceItemValue, replaceItemValue, replaceItemValue, replaceItemValue, replaceItemValue, setValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DirectMapper

public DirectMapper(java.lang.String itemName,
                    java.lang.Class clazz)
             throws MethodNotFoundException
Constructor. Creates a direct mapper where the Notes item name is equal to the itemName attribute and the names of the get/set methods in the business class are equal to "get" + itemName and "set" + itemName.

Parameters:
itemName - name of Notes item
clazz - the value type
Throws:
MethodNotFoundException - if the getter or setter method was not found for the attribute name

DirectMapper

public DirectMapper(java.lang.String itemName,
                    java.lang.String attributeName,
                    java.lang.Class clazz)
             throws MethodNotFoundException
Constructor. Creates a direct mapper where the Notes item name is equal to the itemName attribute and the names of the get/set methods in the business class are equal to "get" + attributeName and "set" + attributeName. Also the prefix "is" is allowed in case of methods returning boolean values.

Parameters:
itemName - name of Notes item
attributeName - name of Java attribute
clazz - the value type
Throws:
MethodNotFoundException - if the getter or setter method was not found for the attribute name

DirectMapper

public DirectMapper(java.lang.String itemName,
                    java.lang.String getName,
                    java.lang.String setName,
                    java.lang.Class clazz)
Constructor. Creates a direct mapper where the Notes item name is equal to the itemName attribute and the names of the get/set methods in the business class are equal to getName and setName.

Parameters:
itemName - name of Notes item
getName - name of get-method
setName - name of set-method
clazz - the value type
Method Detail

map

public void map(DDocument document,
                java.lang.Object object)
         throws MappingException
Performs the direct mapping from a document to a business object.

Parameters:
document - the Notes document
object - the business object
Throws:
MappingException - if an error occurred during mapping

map

public void map(java.lang.Object object,
                DDocument document)
         throws MappingException
Performs the direct mapping from a business object to a document. Allowed objects are of type String, Calendar, Integer, Double or List, where if the object is a List, all values in the list must be of one of the other types.

Parameters:
object - the business object
document - the Notes document
Throws:
MappingException - if an error occurred during mapping


Domingo Java-API