gov.nasa.arc.brahms.common.data
Class JavaClassInfo

java.lang.Object
  extended by gov.nasa.arc.brahms.common.data.JavaClassInfo
All Implemented Interfaces:
IJavaClassInfo

public class JavaClassInfo
extends java.lang.Object
implements IJavaClassInfo

JavaClassInfo provides information about a Java class' properties to access and set values of a Java class or object.

Version:
$Revision: 1.1 $ $Date: 2009/11/23 18:28:41 $ $Author: rnado $
Author:
Ron van Hoof

Constructor Summary
JavaClassInfo(java.lang.Class<?> clz, java.beans.BeanInfo beanInfo)
          Constructor, creates a new JavaClassInfo record for the specified Java Class.
 
Method Summary
 java.beans.BeanInfo getBeanInfo()
          Returns the Java Bean information about all of the introspected bean properties, exposed methods, and events.
 java.util.List<IJavaPropertyDescriptor> getBeanPropertyDescriptors()
           
 java.lang.Class<?> getJavaClass()
          Returns the Java class about which this object managed information.
 IJavaPropertyDescriptor getPropertyDescriptor(java.lang.String name)
          Finds and returns the IJavaPropertyDescriptor for the property with the specified name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaClassInfo

public JavaClassInfo(java.lang.Class<?> clz,
                     java.beans.BeanInfo beanInfo)
Constructor, creates a new JavaClassInfo record for the specified Java Class.

Parameters:
clz - the Java Class for which to manage information
beanInfo - the BeanInfo for the specified clz
Method Detail

getJavaClass

public java.lang.Class<?> getJavaClass()
Returns the Java class about which this object managed information.

Specified by:
getJavaClass in interface IJavaClassInfo
Returns:
Class the Java class

getBeanInfo

public java.beans.BeanInfo getBeanInfo()
Returns the Java Bean information about all of the introspected bean properties, exposed methods, and events. This is a convenience method to access the BeanInfo that may be used by this class to find a Java Property.

Specified by:
getBeanInfo in interface IJavaClassInfo
Returns:
BeanInfo the BeanInfo for the managed class

getPropertyDescriptor

public IJavaPropertyDescriptor getPropertyDescriptor(java.lang.String name)
Finds and returns the IJavaPropertyDescriptor for the property with the specified name. The following algorithm is used to find a property by the specified name:
  1. Use bean introspection to find a property with the specified name. The property is expected to have a getter and/or setter method declared following the bean specification.
  2. If not found via bean introspection, an attempt is made to find a public method with the same name. The property in that case is either read-only (method has a return value and no declared parameters) or is write-only (method has a single parameter and no return value)
  3. If not found as a method, an attempt is made to find a field with the specified name (private/protected/public).

Specified by:
getPropertyDescriptor in interface IJavaClassInfo
Parameters:
name - the name of the property
Returns:
IJavaPropertyDescriptor the descriptor for the property, null if no property with the specified name could be found

getBeanPropertyDescriptors

public java.util.List<IJavaPropertyDescriptor> getBeanPropertyDescriptors()


Copyright © 1997-2012 All Rights Reserved.