org.jboss.portal.faces.el
Class ClassConstantPublisherBean

java.lang.Object
  extended by org.jboss.portal.faces.el.ClassConstantPublisherBean
All Implemented Interfaces:
DynamicBean

public class ClassConstantPublisherBean
extends java.lang.Object
implements DynamicBean

An implementation of DynamicBean which exposes all the fields on a class which are public and static. The properties are read only and cannot be modified. It allows to use constant names from expression language rather than the constant values directly.

todo: implement and test interfaces returned by Class.getInterfaces().

Version:
$Revision: 1.1 $
Author:
Julien Viet

Constructor Summary
ClassConstantPublisherBean()
           
 
Method Summary
 java.lang.String getClassName()
           
 java.lang.Class getType(java.lang.Object propertyName)
          Return the type of the specified property.
 PropertyValue getValue(java.lang.Object propertyName)
          Return the value of the specified property.
 void setClassName(java.lang.String className)
           
 boolean setValue(java.lang.Object propertyName, java.lang.Object value)
          Set the value of the specified property.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ClassConstantPublisherBean

public ClassConstantPublisherBean()
Method Detail

getType

public java.lang.Class getType(java.lang.Object propertyName)
                        throws java.lang.IllegalArgumentException
Description copied from interface: DynamicBean
Return the type of the specified property.

Specified by:
getType in interface DynamicBean
Parameters:
propertyName - the property name
Returns:
the type of the specified property or null
Throws:
java.lang.IllegalArgumentException - if the property name is null

getValue

public PropertyValue getValue(java.lang.Object propertyName)
                       throws java.lang.IllegalArgumentException
Description copied from interface: DynamicBean
Return the value of the specified property.

Specified by:
getValue in interface DynamicBean
Parameters:
propertyName - the property name
Returns:
the property value
Throws:
java.lang.IllegalArgumentException - if the property is null

setValue

public boolean setValue(java.lang.Object propertyName,
                        java.lang.Object value)
                 throws java.lang.IllegalArgumentException
Description copied from interface: DynamicBean
Set the value of the specified property.

Specified by:
setValue in interface DynamicBean
Parameters:
propertyName - the property name
value - the new property value
Returns:
true if the property was succesfully set
Throws:
java.lang.IllegalArgumentException - if the property name is null

getClassName

public java.lang.String getClassName()

setClassName

public void setClassName(java.lang.String className)