org.apache.ojb.broker.metadata.fieldaccess
Class PersistentFieldDynaBeanImpl
java.lang.Object
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldBase
org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDynaBeanImpl
- All Implemented Interfaces:
- PersistentField, java.io.Serializable
- Direct Known Subclasses:
- PersistentFieldDynaBeanImplNew
- public class PersistentFieldDynaBeanImpl
- extends PersistentFieldBase
A PersistentField
implementation accesses a property
from a DynaBean
.
Note that because of the way that PersistentField works,
at run time the type of the field could actually be different, since
it depends on the DynaClass of the DynaBean that is given at runtime.
This implementation does not support nested fields.
- Version:
- $Id: PersistentFieldDynaBeanImpl.java 365232 2005-12-21 22:36:07Z tomdz $
- See Also:
- Serialized Form
Method Summary |
java.lang.Object |
get(java.lang.Object anObject)
Returns the value of the field represented by this PersistentField, on the specified object. |
java.lang.Class |
getType()
|
void |
set(java.lang.Object anObject,
java.lang.Object aValue)
Sets the field represented by this PersistentField object on the specified object argument to the specified new value. |
boolean |
usesAccessorsAndMutators()
|
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PersistentFieldDynaBeanImpl
public PersistentFieldDynaBeanImpl()
PersistentFieldDynaBeanImpl
public PersistentFieldDynaBeanImpl(java.lang.Class aPropertyType,
java.lang.String aPropertyName)
set
public void set(java.lang.Object anObject,
java.lang.Object aValue)
throws MetadataException
- Description copied from interface:
PersistentField
- Sets the field represented by this PersistentField object on the specified object argument to the specified new value.
The new value is automatically unwrapped if the underlying field has a primitive type.
This implementation invokes set() on its underlying Field object if the argument is not null.
OBS IllegalArgumentExceptions are wrapped as PersistenceBrokerExceptions.
- Parameters:
anObject
- The target object (no proxy objects allowed).aValue
- The value to set.
- Throws:
MetadataException
- if there is an error setting this field value on obj- See Also:
Field
get
public java.lang.Object get(java.lang.Object anObject)
throws MetadataException
- Description copied from interface:
PersistentField
- Returns the value of the field represented by this PersistentField, on the specified object.
This implementation invokes get() on its underlying Field object.
- Parameters:
anObject
- - The object instance (proxy objects are not allowed here) which we are
trying to get the field value from.
- Throws:
MetadataException
- if there is an error getting this field value from obj- See Also:
Field
getType
public java.lang.Class getType()
usesAccessorsAndMutators
public boolean usesAccessorsAndMutators()
(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30