private static class MetadataManager.Helper
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private java.lang.Class<?> |
dmoImpl
DMO implementation class
|
private static java.lang.reflect.Method |
idSetter
Primary key setter method
|
private static java.lang.String |
SET_ID
Well-known name of primary key setter method
|
private java.util.Map<java.lang.String,java.lang.reflect.Method> |
setters
Map of DMO property setters (excluding primary key setter)
|
Constructor and Description |
---|
Helper(java.lang.Class<?> dmoIface,
java.lang.Class<?> dmoImpl)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
private java.lang.reflect.Method |
getSetter(java.lang.String property)
Retrieve the DMO property setter method for the specified property name.
|
(package private) void |
setValue(java.lang.Object dmo,
java.lang.String property,
java.lang.String index,
java.lang.Object value)
Set a property value into a DMO instance.
|
private static final java.lang.String SET_ID
private static final java.lang.reflect.Method idSetter
private final java.lang.Class<?> dmoImpl
private final java.util.Map<java.lang.String,java.lang.reflect.Method> setters
Helper(java.lang.Class<?> dmoIface, java.lang.Class<?> dmoImpl)
dmoIface
- DMO interface.dmoImpl
- DMO implementation class.void setValue(java.lang.Object dmo, java.lang.String property, java.lang.String index, java.lang.Object value) throws PersistenceException, java.lang.IllegalAccessException, java.lang.IllegalArgumentException, java.lang.reflect.InvocationTargetException
dmo
- Target DMO instance.property
- Name of property to be set.index
- Optional string representation of index (for extent fields only). Must be the
empty string if property does not represent an extent field. May not be
null
.value
- Value of the appropriate data type (i.e., data wrapper instance) for the target
property.PersistenceException
- if index
cannot be parsed into an Integer
.java.lang.IllegalAccessException
- if the target setter method cannot be accessed.java.lang.IllegalArgumentException
- if value
is the wrong type.java.lang.reflect.InvocationTargetException
- if the underlying setter method throws an exception.private java.lang.reflect.Method getSetter(java.lang.String property) throws PersistenceException
property
- Name of a DMO property (case-sensitive).PersistenceException
- if a setter method cannot be found for the specified property.