public abstract class BaseDMapper extends Object implements Mapper
DNotesRuntimeExceptions into
MappingExceptions.| Constructor and Description |
|---|
BaseDMapper()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
protected Calendar |
getCalendar(Object calendarOrList)
Returns a calendar if the given object is a calendar or
it is a list and the first element in the list is a calendar.
|
protected List |
getValue(DDocument document,
String itemName)
Reads the date value of an item.
|
protected Object |
getValue(Object object,
String getName)
Returns the value of an attribute given by its getter method from given
object.
|
protected Calendar |
getValueDate(DDocument document,
String itemName)
Reads the date value of an item.
|
protected DDateRange |
getValueDateRange(DDocument document,
String itemName)
Reads the DDateRange value of an item.
|
protected Double |
getValueDouble(DDocument document,
String itemName)
Reads the Double value of an item.
|
protected Integer |
getValueInteger(DDocument document,
String itemName)
Reads the Integer value of an item.
|
protected String |
getValueString(DDocument document,
String itemName)
Reads the String value of an item.
|
protected static boolean |
hasMethod(Class clazz,
String name)
Checks if a class contains a method with the specified name and no
arguments.
|
protected void |
replaceItemValue(DDocument document,
String itemName,
Calendar value)
Replaces the value of an item with a Calendar.
|
protected void |
replaceItemValue(DDocument document,
String itemName,
double value)
Replaces the value of an item with a double.
|
protected void |
replaceItemValue(DDocument document,
String itemName,
Double value)
Replaces the value of an item with a Double.
|
protected void |
replaceItemValue(DDocument document,
String itemName,
int value)
Replaces the value of an item with an int.
|
protected void |
replaceItemValue(DDocument document,
String itemName,
Integer value)
Replaces the value of an item with an Integer.
|
protected void |
replaceItemValue(DDocument document,
String itemName,
List value)
Replaces the value of an item with a List.
|
protected void |
replaceItemValue(DDocument document,
String itemName,
String value)
Replaces the value of an item with a String.
|
protected void |
setValue(Object object,
String setName,
Object value,
Class clazz)
Sets a value of an attribute given by its setter method in a given
object.
|
protected final void replaceItemValue(DDocument document, String itemName, String value) throws MappingException
document - document to replace item initemName - name of item to replacevalue - the value to mapMappingException - if the value cannot be mapped to the itemprotected final void replaceItemValue(DDocument document, String itemName, Calendar value) throws MappingException
document - document to replace item initemName - name of item to replacevalue - the value to mapMappingException - if the value cannot be mapped to the itemprotected final void replaceItemValue(DDocument document, String itemName, int value) throws MappingException
document - document to replace item initemName - name of item to replacevalue - the value to mapMappingException - if the value cannot be mapped to the itemprotected final void replaceItemValue(DDocument document, String itemName, Integer value) throws MappingException
document - document to replace item initemName - name of item to replacevalue - the value to mapMappingException - if the value cannot be mapped to the itemprotected final void replaceItemValue(DDocument document, String itemName, double value) throws MappingException
document - document to replace item initemName - name of item to replacevalue - the value to mapMappingException - if the value cannot be mapped to the itemprotected final void replaceItemValue(DDocument document, String itemName, Double value) throws MappingException
document - document to replace item initemName - name of item to replacevalue - the value to mapMappingException - if the value cannot be mapped to the itemprotected final void replaceItemValue(DDocument document, String itemName, List value) throws MappingException
document - document to replace item initemName - name of item to replacevalue - the value to mapMappingException - if the value cannot be mapped to the itemprotected final Calendar getValueDate(DDocument document, String itemName) throws MappingException
document - the domingo document to read fromitemName - the name of the item to read fromMappingException - if the value cannot be readprotected final DDateRange getValueDateRange(DDocument document, String itemName) throws MappingException
document - the domingo document to read fromitemName - the name of the item to read fromMappingException - if the value cannot be readprotected final String getValueString(DDocument document, String itemName) throws MappingException
document - the domingo document to read fromitemName - the name of the item to read fromMappingException - if the value cannot be readprotected final Double getValueDouble(DDocument document, String itemName) throws MappingException
document - the domingo document to read fromitemName - the name of the item to read fromMappingException - if the value cannot be readprotected final Integer getValueInteger(DDocument document, String itemName) throws MappingException
document - the domingo document to read fromitemName - the name of the item to read fromMappingException - if the value cannot be readprotected final List getValue(DDocument document, String itemName) throws MappingException
document - the domingo document to read fromitemName - the name of the item to read fromMappingException - if the value cannot be readprotected final Calendar getCalendar(Object calendarOrList)
protected final Object getValue(Object object, String getName) throws MappingException
object - the objectgetName - the name of the getter methodMappingException - if the given attribute cannot be accessedprotected final void setValue(Object object, String setName, Object value, Class clazz) throws MappingException
object - the objectsetName - the name of the setter methodvalue - the value to setclazz - class name of attributeMappingException - if the given attribute cannot be accessedCopyright © 2005–2020. All rights reserved.