javax.rad.type.bean
Class AbstractBeanType<T>

java.lang.Object
  extended by javax.rad.type.AbstractType<T>
      extended by javax.rad.type.bean.AbstractBeanType<T>
Type Parameters:
T - the type.
All Implemented Interfaces:
IBeanType<T>, IType<T>
Direct Known Subclasses:
BeanType

public abstract class AbstractBeanType<T>
extends AbstractType<T>
implements IBeanType<T>

The AbstractBeanType is a bean definition without a bean object/class. It holds the information about property names and definitions


Field Summary
protected  String className
          The bean class.
protected  PropertyDefinition[] propertyDefinitions
          The property definitions.
protected  String[] propertyNames
          The cached property names.
 
Fields inherited from interface javax.rad.type.IType
UNKNOWN_TYPE
 
Constructor Summary
protected AbstractBeanType()
          Constructs a new AbstractBeanType .
protected AbstractBeanType(String pClassName, PropertyDefinition[] pPropertyDefinitions)
          Constructs a new AbstractBeanType with a class name and PropertyDefinitions.
protected AbstractBeanType(String pClassName, String[] pPropertyNames)
          Constructs a new AbstractBeanType with class name and a property list.
 
Method Summary
 void addPropertyDefinition(PropertyDefinition pPropertyDefinition)
          Adds a property definition.
 void addPropertyDefinition(String pPropertyName)
          Adds a property definition.
protected  PropertyDefinition createPropertyDefinition(String pPropertyName)
          Creates the PropertyDefinition.
protected  PropertyDefinition[] createPropertyDefinitions(int pPropertyCount)
          Creates the PropertyDefinitions.
 boolean equals(Object pObject)
          
 String getClassName()
          Gets the class name or identifier of the bean class.
 int getPropertyCount()
          Gets the amount of properties.
 PropertyDefinition getPropertyDefinition(int pIndex)
          Gets the bean property for the given index.
 PropertyDefinition getPropertyDefinition(String pPropertyName)
          Gets the bean property for the given property name.
 int getPropertyIndex(String pPropertyName)
          Gets the index of the property name.
 String[] getPropertyNames()
          Gets the property names.
 int hashCode()
          
 void removeAllPropertyDefinitions()
          Removes all property definitions.
 
Methods inherited from class javax.rad.type.AbstractType
equals, getTypeFromClass, getTypeFromObject, hashCode, registerType, toString, validatedValueOf, valueOf
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.rad.type.IType
compareTo, getTypeClass
 

Field Detail

className

protected String className
The bean class.


propertyNames

protected String[] propertyNames
The cached property names.


propertyDefinitions

protected transient PropertyDefinition[] propertyDefinitions
The property definitions.

Constructor Detail

AbstractBeanType

protected AbstractBeanType()
Constructs a new AbstractBeanType .


AbstractBeanType

protected AbstractBeanType(String pClassName,
                           String[] pPropertyNames)
Constructs a new AbstractBeanType with class name and a property list.

Parameters:
pClassName - the class name.
pPropertyNames - the bean properties.

AbstractBeanType

protected AbstractBeanType(String pClassName,
                           PropertyDefinition[] pPropertyDefinitions)
Constructs a new AbstractBeanType with a class name and PropertyDefinitions.

Parameters:
pClassName - the class name.
pPropertyDefinitions - the property definitions.
Method Detail

getPropertyNames

public String[] getPropertyNames()
Gets the property names.

Specified by:
getPropertyNames in interface IBeanType<T>
Returns:
the property names.

getPropertyIndex

public int getPropertyIndex(String pPropertyName)
Gets the index of the property name.

Specified by:
getPropertyIndex in interface IBeanType<T>
Parameters:
pPropertyName - the property name.
Returns:
the index.

getPropertyCount

public int getPropertyCount()
Gets the amount of properties.

Specified by:
getPropertyCount in interface IBeanType<T>
Returns:
the amount of properties.

getPropertyDefinition

public PropertyDefinition getPropertyDefinition(int pIndex)
Gets the bean property for the given index.

Specified by:
getPropertyDefinition in interface IBeanType<T>
Parameters:
pIndex - the index.
Returns:
the bean property.

getPropertyDefinition

public PropertyDefinition getPropertyDefinition(String pPropertyName)
Gets the bean property for the given property name.

Specified by:
getPropertyDefinition in interface IBeanType<T>
Parameters:
pPropertyName - the property name.
Returns:
the bean property.

hashCode

public int hashCode()

Overrides:
hashCode in class Object

equals

public boolean equals(Object pObject)

Overrides:
equals in class Object

getClassName

public String getClassName()
Gets the class name or identifier of the bean class. This name has to be unique for every different bean class.

Returns:
the class name.

createPropertyDefinitions

protected PropertyDefinition[] createPropertyDefinitions(int pPropertyCount)
Creates the PropertyDefinitions.

Parameters:
pPropertyCount - the property count
Returns:
the property definitions

createPropertyDefinition

protected PropertyDefinition createPropertyDefinition(String pPropertyName)
Creates the PropertyDefinition.

Parameters:
pPropertyName - the property name.
Returns:
the PropertyDefinition

addPropertyDefinition

public void addPropertyDefinition(PropertyDefinition pPropertyDefinition)
Adds a property definition.

Parameters:
pPropertyDefinition - the property definition.

addPropertyDefinition

public void addPropertyDefinition(String pPropertyName)
Adds a property definition.

Parameters:
pPropertyName - the property definition.

removeAllPropertyDefinitions

public void removeAllPropertyDefinitions()
Removes all property definitions.



Copyright © 2009 SIB Visions GmbH. All Rights Reserved.