net.sf.composite.extract.extractors
Class BasePropertyComponentAccessor

java.lang.Object
  extended by net.sf.composite.extract.extractors.BaseComponentAccessor
      extended by net.sf.composite.extract.extractors.BasePropertyComponentAccessor
All Implemented Interfaces:
ComponentAccessor
Direct Known Subclasses:
ContainerPropertyComponentAccessor

public abstract class BasePropertyComponentAccessor
extends BaseComponentAccessor

Extracts the components of a composite by using reflection to access the getter method for a set property name

Since:
Feb 2, 2006
Author:
Matt Sgarlata

Field Summary
 
Fields inherited from class net.sf.composite.extract.extractors.BaseComponentAccessor
log
 
Constructor Summary
BasePropertyComponentAccessor()
           
BasePropertyComponentAccessor(java.lang.String componentProperty)
           
 
Method Summary
 java.lang.String getComponentProperty()
           
protected  java.lang.Class getType(java.lang.Object object, java.lang.String propertyName)
          Returns the type of the property of the target object, as determined by the return type of the getter method for that property
protected  java.lang.Object invokeGetter(java.lang.Object object, java.lang.String propertyName)
          Returns the value of the property propertyName in target object.
protected  void invokeSetter(java.lang.Object object, java.lang.String propertyName, java.lang.Object value)
          Sets the value of the property propertyname to the value value for the target object.
 void setComponentProperty(java.lang.String componentProperty)
           
 
Methods inherited from class net.sf.composite.extract.extractors.BaseComponentAccessor
getComponents, getComponentsImpl, setComponents, setComponentsImpl
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePropertyComponentAccessor

public BasePropertyComponentAccessor()

BasePropertyComponentAccessor

public BasePropertyComponentAccessor(java.lang.String componentProperty)
Method Detail

getType

protected java.lang.Class getType(java.lang.Object object,
                                  java.lang.String propertyName)
                           throws java.lang.Exception
Returns the type of the property of the target object, as determined by the return type of the getter method for that property

Parameters:
object - the object
propertyName - the name of the property for which we would like to know the type
Throws:
java.lang.Exception - if an error occurrs

invokeGetter

protected java.lang.Object invokeGetter(java.lang.Object object,
                                        java.lang.String propertyName)
                                 throws java.lang.Exception
Returns the value of the property propertyName in target object.

Parameters:
object - the object
propertyName - the name of the property to read
Throws:
java.lang.Exception - if an error occurrs

invokeSetter

protected void invokeSetter(java.lang.Object object,
                            java.lang.String propertyName,
                            java.lang.Object value)
                     throws java.lang.Exception
Sets the value of the property propertyname to the value value for the target object.

Parameters:
object - the object
propertyName - the name of the property to change
value - the new value for the property
Throws:
java.lang.Exception - if an error occurrs

getComponentProperty

public java.lang.String getComponentProperty()

setComponentProperty

public void setComponentProperty(java.lang.String componentProperty)


Copyright © 2005-2008.