raccoon.api.bean.descriptor
Interface IBeanDescriptor

All Known Implementing Classes:
BeanDescriptor

public interface IBeanDescriptor

The descriptor for a given java bean class.

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

Method Summary
 void addProperty(IBeanProperty pProperty)
          Adds a new bean property to the current list of bean properties.
 int analyzeProperties()
          Parses all the properties assigned to this instance in order to set correctly the fields isAtomic, isCastorBean and isRaccoonBean.
 boolean containsProperty(java.lang.String pPropertyName)
          Determines whether or not the property is contained by this instance.
 java.lang.String getClassName()
          The class that this instance bears information on.
 IBeanProperty getProperty(java.lang.String pPropertyName)
          Convenience method for retrieving a specific property descriptor.
 boolean hasDefaultConstructor()
          Is the associated java bean dynamically instanciable.
 boolean isCastorBean()
          Convenience method for determining the type of bean this instance is.
 boolean isParsed()
          Have the methods assigned to this instance been analyzed to determine the type of bean.
 boolean isRaccoonBean()
          Convenience method for determining the type of bean this instance is.
 java.util.Iterator properties()
          The list of avaible properties of this java bean instance.
 java.util.Iterator propertyNames()
          The names of the available java bean properties within this BeanDescriptor.
 void setClassName(java.lang.String pClassName)
          Defines the name of the class that this instance represents.
 

Method Detail

getClassName

java.lang.String getClassName()
The class that this instance bears information on.

Returns:
the class name
See Also:
setClassName(String)

setClassName

void setClassName(java.lang.String pClassName)
                  throws RaccoonException
Defines the name of the class that this instance represents.
For example if this instance represents a Person class, then pClassName is worth Person.class.getName()

Parameters:
pClassName - the class name contained in this object
Throws:
RaccoonException - if the component is in a read only state.
See Also:
isParsed()

addProperty

void addProperty(IBeanProperty pProperty)
                 throws RaccoonException
Adds a new bean property to the current list of bean properties.

Parameters:
pProperty - the bean property to add.
Throws:
RaccoonException - if the component is in a read only state.
See Also:
isParsed()

getProperty

IBeanProperty getProperty(java.lang.String pPropertyName)
                          throws RaccoonException
Convenience method for retrieving a specific property descriptor. The property descriptor is stored under the index: IBeanProperty.lPropertyName()

Parameters:
pPropertyName - the lower bean name of the property (for example: nameOfPerson and not NameOfPerson
Returns:
the property descriptor instance corresponding to the given logical name.
Throws:
RaccoonException - if the property wasn't found.
See Also:
containsProperty(String)

propertyNames

java.util.Iterator propertyNames()
                                 throws RaccoonException
The names of the available java bean properties within this BeanDescriptor.

Returns:
an enumeration of String which are the java property names of the given java bean
Throws:
RaccoonException - if the method analyzeProperties() wasn't called previously.

properties

java.util.Iterator properties()
                              throws RaccoonException
The list of avaible properties of this java bean instance.

Returns:
an enumeration of IBeanProperty elements
Throws:
RaccoonException - if the method analyzeProperties() wasn't called previously.

containsProperty

boolean containsProperty(java.lang.String pPropertyName)
Determines whether or not the property is contained by this instance.

Parameters:
pPropertyName - the lower bean name of the property (for example: nameOfPerson and not NameOfPerson
Returns:
true if there is a property descriptor for the specified property.

isParsed

boolean isParsed()
Have the methods assigned to this instance been analyzed to determine the type of bean.

It is possible to add methods (properties) to this instance as long as this method returns false. Once it returns true, it means that the list of methods have been analyzed to determine the type of bean this instance represents. It is then no longer possible to change the data contained within this instance.

Returns:
true if the properties have been analyzed (the class becomes read only)

isCastorBean

boolean isCastorBean()
Convenience method for determining the type of bean this instance is. Valid only if isParsed() returns true.

Returns:
the compliance or not to the Castor spec of a bean.

isRaccoonBean

boolean isRaccoonBean()
Convenience method for determining the type of bean this instance is. Valid only if isParsed() returns true.

Returns:
the compliance or not to the Raccoon spec of a bean.

analyzeProperties

int analyzeProperties()
                      throws RaccoonException
Parses all the properties assigned to this instance in order to set correctly the fields isAtomic, isCastorBean and isRaccoonBean.

Returns:
the number of properties attached to this instance.
Throws:
RaccoonException - if some props wheren't set or if the component is in error

hasDefaultConstructor

boolean hasDefaultConstructor()
Is the associated java bean dynamically instanciable.

Returns:
true if there is a default constructor.


Copyright null null. All Rights Reserved.