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

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

public class PersistentFieldIntrospectorImpl
extends AbstractPersistentField

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.

Version:
$Id: PersistentFieldIntrospectorImpl.java,v 1.4 2004/01/07 19:11:10 arminw Exp $
Author:
Jakob Braeuchi, Armin Waibel
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField
field, fieldName, PATH_TOKEN, PERSISTENT_FIELD_IMPL_FOR_NESTED, rootObjectType
 
Constructor Summary
PersistentFieldIntrospectorImpl()
           
PersistentFieldIntrospectorImpl(java.lang.Class aClass, java.lang.String aPropertyName)
           
 
Method Summary
 java.lang.Object doGet(java.lang.Object anObject)
          Get the Value from anObject
 void doSet(java.lang.Object anObject, java.lang.Object aValue)
          Sets aValue for anObject
protected  java.beans.PropertyDescriptor findPropertyDescriptor(java.lang.Class aClass, java.lang.String aPropertyName)
          Get the PropertyDescriptor for aClass and aPropertyName
 java.lang.Class getDeclaringClass()
           
 java.lang.String getName()
           
protected  java.beans.PropertyDescriptor getPropertyDescriptor()
          Returns the PropertyDescriptor.
 java.lang.Class getType()
           
protected  void logProblem(java.lang.Object anObject, java.lang.Object aValue, java.lang.String msg)
          Let's give the user some hints as to what could be wrong.
 boolean makeAccessible()
          This implementation returns always 'false'.
protected  void setPropertyDescriptor(java.beans.PropertyDescriptor newPropertyDescriptor)
          Set PropertyDescriptor.
 boolean usesAccessorsAndMutators()
          Always returns 'false'.
 
Methods inherited from class org.apache.ojb.broker.metadata.fieldaccess.AbstractPersistentField
buildMessageString, get, getField, getLog, getNestedObject, isNestedField, set, setNestedObject, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentFieldIntrospectorImpl

public PersistentFieldIntrospectorImpl()

PersistentFieldIntrospectorImpl

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

getName

public java.lang.String getName()
Specified by:
getName in interface PersistentField
Overrides:
getName in class AbstractPersistentField

getType

public java.lang.Class getType()
Specified by:
getType in interface PersistentField
Overrides:
getType in class AbstractPersistentField

getDeclaringClass

public java.lang.Class getDeclaringClass()
Specified by:
getDeclaringClass in interface PersistentField
Overrides:
getDeclaringClass in class AbstractPersistentField

doSet

public void doSet(java.lang.Object anObject,
                  java.lang.Object aValue)
           throws MetadataException
Sets aValue for anObject

Specified by:
doSet in class AbstractPersistentField
Throws:
MetadataException

doGet

public java.lang.Object doGet(java.lang.Object anObject)
                       throws MetadataException
Get the Value from anObject

Specified by:
doGet in class AbstractPersistentField
Throws:
MetadataException

findPropertyDescriptor

protected java.beans.PropertyDescriptor findPropertyDescriptor(java.lang.Class aClass,
                                                               java.lang.String aPropertyName)
Get the PropertyDescriptor for aClass and aPropertyName


getPropertyDescriptor

protected java.beans.PropertyDescriptor getPropertyDescriptor()
Returns the PropertyDescriptor.

Returns:
java.beans.PropertyDescriptor

setPropertyDescriptor

protected void setPropertyDescriptor(java.beans.PropertyDescriptor newPropertyDescriptor)
Set PropertyDescriptor.

Parameters:
newPropertyDescriptor - java.beans.PropertyDescriptor

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()

logProblem

protected void logProblem(java.lang.Object anObject,
                          java.lang.Object aValue,
                          java.lang.String msg)
Let's give the user some hints as to what could be wrong.



Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14