raccoon.api.bean.descriptor
Interface IBeanProperty

All Known Implementing Classes:
BeanProperty

public interface IBeanProperty

The descriptor of java bean.

Currently there two different properties:

  1. Castor property: Complies with the definition of a property within the scope of the project Castor.
  2. Raccoon property: Complies with the definition of a property within the scope of the project Raccoon.

Castor property

A valid Castor bean method must meet the following criteria:

A valid example is:

A invalid example is:

Another invalid example is:

Raccoon property

If the property isn't a collection property then a Raccoon property is exactly the same as Castor property.

If the property is a collection property than another method must be implemented: addElement A valid example is:

Since:
Raccoon v0.7
Version:
$Id: IBeanProperty.java,v 1.1 2004/08/08 20:25:55 crouvrais Exp $
Author:
Cedric ROUVRAIS

Method Summary
 java.lang.reflect.Method adder()
          Returns the addMethod for this bean, used to add an element to a collection of a java bean.
 void append(java.lang.Object pInstance, java.lang.Object pData)
          Adds an element to this object, this object being a collection.
 java.lang.Class beanType()
          Returns the type of class that this method handles.
 java.lang.Class collectionType()
          Returns the atomic type of the collection, a call to this method is valid.
 java.lang.reflect.Method getter()
          Returns the getMethod for this bean, used to invoke the getMethod.
 boolean isCastorProperty()
          Checks if this property is a valid Castor property.
 boolean isCollectionProperty()
          Checks if this class is a Collection defined by the Raccoon project.
 boolean isRaccoonProperty()
          Checks if this property is a valid Raccoon property.
 java.lang.String lPropertyName()
          Extracts the name of this property.
 java.lang.Object read(java.lang.Object pInstance)
          Reads the value of this property from a given object instance.
 java.lang.reflect.Method setter()
          Returns the setMethod for this bean, used to invoke the setMethod.
 java.lang.String uPropertyName()
          Extracts the name of this property.
 void write(java.lang.Object pInstance, java.lang.Object pData)
          Sets the value of this object.
 

Method Detail

isCastorProperty

boolean isCastorProperty()
Checks if this property is a valid Castor property.

Returns:
true if this is a valid Castor property.

isRaccoonProperty

boolean isRaccoonProperty()
Checks if this property is a valid Raccoon property.

Returns:
true if this is a valid Raccoon property.

isCollectionProperty

boolean isCollectionProperty()
Checks if this class is a Collection defined by the Raccoon project.

A Collection meets the following criteria:

Returns:
true if this method is a collection.

lPropertyName

java.lang.String lPropertyName()
Extracts the name of this property.

Returns:
the bean name, first letter is lower case.

uPropertyName

java.lang.String uPropertyName()
Extracts the name of this property.

Returns:
the property name, first letter is upper case.

beanType

java.lang.Class beanType()
Returns the type of class that this method handles.
For example if beanType returns String.class then the following methods are available:
If beanType returns Vector.class then the following methods are available:
Or:
Where the type of the Object is defined by the method collectionType()

Returns:
the type of the bean

collectionType

java.lang.Class collectionType()
Returns the atomic type of the collection, a call to this method is valid. only if isCollectionProperty returns true

Returns:
type of atomic element.

getter

java.lang.reflect.Method getter()
Returns the getMethod for this bean, used to invoke the getMethod. of a java bean. The return type of this method is provided by the method beanType().

Returns:
the getMethod for this class.

setter

java.lang.reflect.Method setter()
Returns the setMethod for this bean, used to invoke the setMethod. of a java bean. This method takes a single parameter, this parameter must be an instance of the class provided by the method beanType().

Returns:
the setMethod for this class.

adder

java.lang.reflect.Method adder()
Returns the addMethod for this bean, used to add an element to a collection of a java bean. This method takes a single parameter, this parameter must be an instance of the class provided by the method collectionType().

Returns:
the addMethod for this class.

read

java.lang.Object read(java.lang.Object pInstance)
                      throws RaccoonException
Reads the value of this property from a given object instance.

Parameters:
pInstance - the instance of the object on which the getMethod will be invoked.
Returns:
the object returned by the invocation of the getter.
Throws:
RaccoonException - shouldn't be thrown.

write

void write(java.lang.Object pInstance,
           java.lang.Object pData)
           throws RaccoonException
Sets the value of this object.

Parameters:
pInstance - the instance of the object on which the setMethod will be invoked.
pData - the data that passed on to the setMethod that will be invoked.
Throws:
RaccoonException - if the setMethod and object pData don't match.

append

void append(java.lang.Object pInstance,
            java.lang.Object pData)
            throws RaccoonException
Adds an element to this object, this object being a collection.

Parameters:
pInstance - the instance of the object on which the addMethod will be invoked.
pData - the data that passed on to the addMethod that will be invoked.
Throws:
RaccoonException - if the addMethod and object pData don't match.


Copyright null null. All Rights Reserved.