org.apache.ojb.broker.metadata.fieldaccess
Class PersistentFieldIntrospectorImplNew

java.lang.Object
  extended byorg.apache.ojb.broker.metadata.fieldaccess.PersistentFieldBase
      extended byorg.apache.ojb.broker.metadata.fieldaccess.PersistentFieldIntrospectorImplNew
All Implemented Interfaces:
PersistentField, java.io.Serializable

public class PersistentFieldIntrospectorImplNew
extends PersistentFieldBase

A PersistentField implementation using JavaBeans compliant calls only to access persistent attributes. No Reflection is needed. But for each attribute xxx there must be public getXxx() and setXxx() methods. In metadata the field name must be the bean compliant 'xxx'.

Version:
$Id: PersistentFieldIntrospectorImplNew.java,v 1.3 2004/06/27 13:48:32 arminw Exp $
Author:
Jakob Braeuchi, Armin Waibel
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldBase
PATH_TOKEN
 
Constructor Summary
PersistentFieldIntrospectorImplNew()
           
PersistentFieldIntrospectorImplNew(java.lang.Class aClass, java.lang.String aPropertyName)
           
 
Method Summary
 java.lang.Object get(java.lang.Object target)
          Returns the value of the field represented by this PersistentField, on the specified object.
 java.lang.Class getType()
           
 boolean makeAccessible()
          This implementation returns always 'false'.
 void set(java.lang.Object target, java.lang.Object value)
          Sets the field represented by this PersistentField object on the specified object argument to the specified new value.
 boolean usesAccessorsAndMutators()
          Always returns 'false'.
 
Methods inherited from class org.apache.ojb.broker.metadata.fieldaccess.PersistentFieldBase
getDeclaringClass, getName, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentFieldIntrospectorImplNew

public PersistentFieldIntrospectorImplNew()

PersistentFieldIntrospectorImplNew

public PersistentFieldIntrospectorImplNew(java.lang.Class aClass,
                                          java.lang.String aPropertyName)
Method Detail

getType

public java.lang.Class getType()

set

public void set(java.lang.Object target,
                java.lang.Object value)
         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.

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 target)
                     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:
target - - the object instance 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

makeAccessible

public boolean makeAccessible()
This implementation returns always 'false'.

See Also:
AbstractPersistentField.makeAccessible()

usesAccessorsAndMutators

public boolean usesAccessorsAndMutators()
Always returns 'false'.

See Also:
PersistentField.usesAccessorsAndMutators()


(C) 2002 - 2004 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.3, 2005-04-2