com.caucho.util
Class BeanUtil

java.lang.Object
  extended by com.caucho.util.BeanUtil

public class BeanUtil
extends java.lang.Object

Bean utilities.


Constructor Summary
BeanUtil()
           
 
Method Summary
static java.lang.Class getBeanPropertyClass(java.lang.Object obj, java.lang.String name)
          Returns the bean property type.
static java.lang.reflect.Method getBeanPropertyMethod(java.lang.Object obj, java.lang.String name)
          Returns the bean property type.
static java.lang.reflect.Method getGetMethod(java.beans.BeanInfo info, java.lang.String propertyName)
          Returns a set method matching the property name.
static java.lang.reflect.Method getGetMethod(java.lang.Class cl, java.lang.String propertyName)
          Returns a get method matching the property name.
static java.lang.reflect.Method getGetMethod(java.lang.Class cl, java.lang.String propertyName, boolean ignoreCase)
          Returns a get method matching the property name.
static java.lang.reflect.Method getSetMethod(java.beans.BeanInfo info, java.lang.String propertyName)
          Returns a set method matching the property name.
static java.lang.reflect.Method getSetMethod(java.lang.Class cl, java.lang.String propertyName)
          Returns a set method matching the property name.
static java.lang.reflect.Method getSetMethod(java.lang.Class cl, java.lang.String propertyName, boolean ignoreCase)
          Returns a set method matching the property name.
static Path lookupPath(java.lang.String pathName, java.util.HashMap varMap, Path pwd)
          Returns the native path for a configured path name.
static java.lang.String methodNameToPropertyName(java.beans.BeanInfo info, java.lang.String methodName)
          Converts a user's property name to a bean method name.
static java.lang.String methodNameToPropertyName(java.lang.String methodName)
          Converts a user's property name to a bean method name.
static java.lang.String propertyNameToMethodName(java.lang.String propertyName)
          Converts a user's property name to a bean method name.
static void validateClass(java.lang.Class cl, java.lang.Class parent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BeanUtil

public BeanUtil()
Method Detail

getBeanPropertyClass

public static java.lang.Class getBeanPropertyClass(java.lang.Object obj,
                                                   java.lang.String name)
Returns the bean property type.

Parameters:
obj - the bean object
name - the property name

getBeanPropertyMethod

public static java.lang.reflect.Method getBeanPropertyMethod(java.lang.Object obj,
                                                             java.lang.String name)
Returns the bean property type.

Parameters:
obj - the bean object
name - the property name

validateClass

public static void validateClass(java.lang.Class cl,
                                 java.lang.Class parent)
                          throws RegistryException
Throws:
RegistryException

lookupPath

public static Path lookupPath(java.lang.String pathName,
                              java.util.HashMap varMap,
                              Path pwd)
Returns the native path for a configured path name. The special cases $app-dir and $resin-home specify the root directory.

Parameters:
pathName - the configuration path name.
varMap - the map of path variables.
pwd - the default path.
Returns:
a real path corresponding to the path name

getSetMethod

public static java.lang.reflect.Method getSetMethod(java.beans.BeanInfo info,
                                                    java.lang.String propertyName)
Returns a set method matching the property name.


getSetMethod

public static java.lang.reflect.Method getSetMethod(java.lang.Class cl,
                                                    java.lang.String propertyName)
Returns a set method matching the property name.


getSetMethod

public static java.lang.reflect.Method getSetMethod(java.lang.Class cl,
                                                    java.lang.String propertyName,
                                                    boolean ignoreCase)
Returns a set method matching the property name.


getGetMethod

public static java.lang.reflect.Method getGetMethod(java.beans.BeanInfo info,
                                                    java.lang.String propertyName)
Returns a set method matching the property name.


getGetMethod

public static java.lang.reflect.Method getGetMethod(java.lang.Class cl,
                                                    java.lang.String propertyName)
Returns a get method matching the property name.


getGetMethod

public static java.lang.reflect.Method getGetMethod(java.lang.Class cl,
                                                    java.lang.String propertyName,
                                                    boolean ignoreCase)
Returns a get method matching the property name.


propertyNameToMethodName

public static java.lang.String propertyNameToMethodName(java.lang.String propertyName)
Converts a user's property name to a bean method name.

Parameters:
propertyName - the user property name
Returns:
the equivalent bean method name

methodNameToPropertyName

public static java.lang.String methodNameToPropertyName(java.beans.BeanInfo info,
                                                        java.lang.String methodName)
Converts a user's property name to a bean method name.

Parameters:
methodName - the method name
Returns:
the equivalent property name

methodNameToPropertyName

public static java.lang.String methodNameToPropertyName(java.lang.String methodName)
Converts a user's property name to a bean method name.

Parameters:
methodName - the method name
Returns:
the equivalent property name