NextApp Echo3
v3.0.b4

nextapp.echo.app.reflect
Class ObjectIntrospector

java.lang.Object
  extended by nextapp.echo.app.reflect.ObjectIntrospector
Direct Known Subclasses:
ComponentIntrospector

public class ObjectIntrospector
extends java.lang.Object

Provides introspection/reflection capabilities for components, proeprties, and layout data objects. Wraps Java beans and reflection APIs.


Field Summary
static int PUBLIC_CONSTANT_MODIFERS
          Modifier requirements for style constant name fields.
 
Constructor Summary
protected ObjectIntrospector(java.lang.String typeName, java.lang.ClassLoader classLoader)
          Creates a new ObjectIntrospector for the specified type.
 
Method Summary
 java.util.Set getConstantNames()
          Returns the constant names of the object.
 java.lang.Object getConstantValue(java.lang.String constantName)
          Retrieves the value of the constant with the specified name.
 java.util.Set getEventHandlerNames(java.lang.String eventSetName)
          Returns event handler names for a given event set.
 java.beans.EventSetDescriptor getEventSetDescriptor(java.lang.String eventSetName)
          Returns the EventSetDescriptor for the specified event set.
 java.util.Set getEventSetNames()
          Returns the event set names of the object.
 java.lang.Class getObjectClass()
          Returns the Class of the object being introspected.
 java.lang.Class getPropertyClass(java.lang.String propertyName)
          Returns the Class of a specific property.
 int getPropertyCount()
          Returns the number of mutable properties provided by the introspected Object.
 java.lang.String getPropertyDefinitionConcreteType(java.lang.String propertyName)
          Returns the name of the type that defines the specified property.
 java.lang.String getPropertyDefinitionType(java.lang.String propertyName)
          Returns the name of the type that defines the specified property.
 java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
          Returns the PropertyDescriptor for the specified property.
 java.util.Iterator getPropertyNames()
          Returns an Iterator over the property names of the object.
 java.lang.reflect.Method getWriteMethod(java.lang.String propertyName)
          Returns a write (setter) method for a specific property.
 boolean isIndexedProperty(java.lang.String propertyName)
          Determines whether a property is an indexed property.
 void setProperty(java.lang.Object object, java.lang.String propertyName, int index, java.lang.Object propertyValue)
          Sets a property on an object instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PUBLIC_CONSTANT_MODIFERS

public static final int PUBLIC_CONSTANT_MODIFERS
Modifier requirements for style constant name fields.

See Also:
Constant Field Values
Constructor Detail

ObjectIntrospector

protected ObjectIntrospector(java.lang.String typeName,
                             java.lang.ClassLoader classLoader)
                      throws java.lang.ClassNotFoundException
Creates a new ObjectIntrospector for the specified type.

Parameters:
typeName - the object type name
classLoader - the ClassLoader to use for introspection
Throws:
java.lang.ClassNotFoundException
Method Detail

getConstantNames

public java.util.Set getConstantNames()
Returns the constant names of the object.

Returns:
a Set containing the constant names of the object

getConstantValue

public java.lang.Object getConstantValue(java.lang.String constantName)
Retrieves the value of the constant with the specified name.

Parameters:
constantName - the name of the constant (unqualified)
Returns:
the constant value, or null if no such constant exists

getEventHandlerNames

public java.util.Set getEventHandlerNames(java.lang.String eventSetName)
Returns event handler names for a given event set.

Parameters:
eventSetName - the name of the event set, e.g., 'nextapp.echo.app.event.Action' for ActionEvents
Returns:
a Set containing the names of event listener methods

getEventSetDescriptor

public java.beans.EventSetDescriptor getEventSetDescriptor(java.lang.String eventSetName)
Returns the EventSetDescriptor for the specified event set.

Parameters:
eventSetName - The name of the event set.
Returns:
the EventSetDescriptor associated with the event set

getEventSetNames

public java.util.Set getEventSetNames()
Returns the event set names of the object.

Returns:
a Set containing the event set names of the object

getObjectClass

public java.lang.Class getObjectClass()
Returns the Class of the object being introspected.

Returns:
the object Class

getPropertyClass

public java.lang.Class getPropertyClass(java.lang.String propertyName)
Returns the Class of a specific property.

Parameters:
propertyName - the name of the property
Returns:
the Class of the property

getPropertyCount

public int getPropertyCount()
Returns the number of mutable properties provided by the introspected Object.

Returns:
the number of mutable properties

getPropertyDefinitionConcreteType

public java.lang.String getPropertyDefinitionConcreteType(java.lang.String propertyName)
Returns the name of the type that defines the specified property.

Parameters:
propertyName - the name of the property
Returns:
the defining class

getPropertyDefinitionType

public java.lang.String getPropertyDefinitionType(java.lang.String propertyName)
Returns the name of the type that defines the specified property.

Parameters:
propertyName - the name of the property
Returns:
the defining class

getPropertyDescriptor

public java.beans.PropertyDescriptor getPropertyDescriptor(java.lang.String propertyName)
Returns the PropertyDescriptor for the specified property.

Parameters:
propertyName - The name of the property.
Returns:
the PropertyDescriptor associated with the property

getPropertyNames

public java.util.Iterator getPropertyNames()
Returns an Iterator over the property names of the object.

Returns:
an Iterator over the property names of the object

getWriteMethod

public java.lang.reflect.Method getWriteMethod(java.lang.String propertyName)
Returns a write (setter) method for a specific property.

Parameters:
propertyName - the name of the property
Returns:
the write method (if available)

isIndexedProperty

public boolean isIndexedProperty(java.lang.String propertyName)
Determines whether a property is an indexed property.

Parameters:
propertyName - the name of the property to query
Returns:
true if the specified property is indexed

setProperty

public void setProperty(java.lang.Object object,
                        java.lang.String propertyName,
                        int index,
                        java.lang.Object propertyValue)
                 throws java.lang.IllegalArgumentException,
                        java.lang.IllegalAccessException,
                        java.lang.reflect.InvocationTargetException
Sets a property on an object instance.

Parameters:
object - the object to modify
propertyName - the property name to be set
propertyValue - the new property value
Throws:
java.lang.IllegalArgumentException
java.lang.IllegalAccessException
java.lang.reflect.InvocationTargetException

NextApp Echo3
v3.0.b4