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

java.lang.Object
  extended byorg.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField
      extended byorg.apache.ojb.broker.metadata.fieldaccess.PersistentFieldDirectAccessImpl
All Implemented Interfaces:
PersistentField, java.io.Serializable
Direct Known Subclasses:
PersistentFieldPrivilegedImpl

public class PersistentFieldDirectAccessImpl
extends AbstractPersistentField

A PersistentField implementation is a high-speed version of the access strategies. It does not cooperate with an AccessController, but accesses the fields directly. This implementation persistent attributes don't need getters and setters and don't have to be declared public or protected

Version:
$Id: PersistentFieldDirectAccessImpl.java,v 1.13 2004/04/09 13:22:29 tomdz Exp $
Author:
Thomas Mahler, Armin Waibel
See Also:
Serialized Form

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

Constructor Detail

PersistentFieldDirectAccessImpl

public PersistentFieldDirectAccessImpl()

PersistentFieldDirectAccessImpl

public PersistentFieldDirectAccessImpl(java.lang.Class type,
                                       java.lang.String fieldname)
Method Detail

doSet

public void doSet(java.lang.Object obj,
                  java.lang.Object value)
           throws MetadataException
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.

Specified by:
doSet in class AbstractPersistentField
Throws:
MetadataException - if there is an error setting this field value on obj
See Also:
Field

doGet

public java.lang.Object doGet(java.lang.Object obj)
                       throws MetadataException
Returns the value of the field represented by this PersistentField, on the specified object. This implementation invokes get() on its underlying Field object.

Specified by:
doGet in class AbstractPersistentField
Parameters:
obj - - 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'.

Specified by:
makeAccessible in class AbstractPersistentField
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