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

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

public class PersistentFieldPrivilegedImpl
extends PersistentFieldDirectAccessImpl

A PersistentField implementation using reflection to access but does cooperate with AccessController and do not suppress the java language access check.

Version:
$Id: PersistentFieldPrivilegedImpl.java,v 1.11 2004/04/04 23:53:35 brianm Exp $
Author:
Thomas Mahler, Armin Waibel
See Also:
PersistentFieldDirectAccessImpl, Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField
PATH_TOKEN, PERSISTENT_FIELD_IMPL_FOR_NESTED
 
Constructor Summary
PersistentFieldPrivilegedImpl()
           
PersistentFieldPrivilegedImpl(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

PersistentFieldPrivilegedImpl

public PersistentFieldPrivilegedImpl()

PersistentFieldPrivilegedImpl

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

doSet

public void doSet(java.lang.Object obj,
                  java.lang.Object value)
           throws MetadataException
Description copied from class: PersistentFieldDirectAccessImpl
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.

Overrides:
doSet in class PersistentFieldDirectAccessImpl
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
Description copied from class: PersistentFieldDirectAccessImpl
Returns the value of the field represented by this PersistentField, on the specified object. This implementation invokes get() on its underlying Field object.

Overrides:
doGet in class PersistentFieldDirectAccessImpl
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'.

Overrides:
makeAccessible in class PersistentFieldDirectAccessImpl
See Also:
AbstractPersistentField.makeAccessible()

usesAccessorsAndMutators

public boolean usesAccessorsAndMutators()
Always returns 'false'.

Specified by:
usesAccessorsAndMutators in interface PersistentField
Overrides:
usesAccessorsAndMutators in class PersistentFieldDirectAccessImpl
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