net.sf.spif.persistence
Class PersistentProperty

java.lang.Object
  |
  +--net.sf.spif.persistence.PersistentProperty
Direct Known Subclasses:
MatchProperty

public class PersistentProperty
extends java.lang.Object

Ignore - public for testing only.

A persistent property and how to access it.

Version:
$Id: PersistentProperty.java,v 1.4 2003/02/13 22:13:44 bratseth Exp $
Author:
Jon S Bratseth

Constructor Summary
protected PersistentProperty(java.lang.String name, java.lang.reflect.Method getter, java.lang.reflect.Method setter)
          Use newInstance
 
Method Summary
protected  java.lang.reflect.Method getGetter()
           
 java.lang.String getName()
          Returns the name of this property.
 java.lang.Object getOn(java.lang.Object object)
           
protected  java.lang.reflect.Method getSetter()
           
 java.lang.Class getType()
          Returns the type of this property (not the containing type)
 boolean isMatched()
          Returns whether this property is matched
static PersistentProperty newInstance(java.lang.String name, java.lang.Class type)
          Creates a persistent property.
protected  void setGetter(java.lang.reflect.Method getter)
          Sets the getter, and the property type, which is the return type of the getter
 void setOn(java.lang.Object object, java.lang.Object value)
           
protected  void setSetter(java.lang.reflect.Method setter)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PersistentProperty

protected PersistentProperty(java.lang.String name,
                             java.lang.reflect.Method getter,
                             java.lang.reflect.Method setter)
Use newInstance

Method Detail

newInstance

public static PersistentProperty newInstance(java.lang.String name,
                                             java.lang.Class type)
Creates a persistent property. If the property is not found in the given type, a MatchProperty subclass is created, to make the property eligible for matching by depentants of the type

Parameters:
name - the name of the property
type - the type which possibly contains the property (and not the type of the property itself)

getName

public java.lang.String getName()
Returns the name of this property. This must be the same as the name of the db column, but the object property will only be accessed through the get and set method. Note that names are always lowercase only.


setOn

public void setOn(java.lang.Object object,
                  java.lang.Object value)
           throws ReflectionException
ReflectionException

getOn

public java.lang.Object getOn(java.lang.Object object)
                       throws ReflectionException
ReflectionException

setGetter

protected void setGetter(java.lang.reflect.Method getter)
Sets the getter, and the property type, which is the return type of the getter


setSetter

protected void setSetter(java.lang.reflect.Method setter)

getGetter

protected java.lang.reflect.Method getGetter()

getSetter

protected java.lang.reflect.Method getSetter()

getType

public java.lang.Class getType()
Returns the type of this property (not the containing type)


isMatched

public boolean isMatched()
Returns whether this property is matched


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


Spif 1.01 (2003-04-03). http://spif.sf.net