org.clazzes.util.reflect
Class PropertyHelper

java.lang.Object
  extended by org.clazzes.util.reflect.PropertyHelper

public class PropertyHelper
extends java.lang.Object

This class provides some static function for transformting property names to getter/setter names.

Author:
wglas

Method Summary
static java.lang.String getBooleanGetterName(java.lang.String property)
          This method complements the functionality of getGetterName(String) for boolen properties, where the getter method start with the string "is" instead of "get".
static java.lang.String getBooleanPropertyFromGetterName(java.lang.String getterName)
          Returns the property name of a given getter method name for boolean fields.
static java.lang.String getGetterName(java.lang.String property)
           
static java.lang.String getPropertyFromGetterName(java.lang.String getterName)
          Returns the property name of a given getter method name.
static java.lang.String getPropertyFromSetterName(java.lang.String setterName)
          Returns the property name of a given setter method name.
static java.lang.String getSetterName(java.lang.String property)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getGetterName

public static java.lang.String getGetterName(java.lang.String property)
Parameters:
property - The property for which to retrieve the getter name.
Returns:
The name of the getter method for the given property.
See Also:
getBooleanGetterName(String)

getSetterName

public static java.lang.String getSetterName(java.lang.String property)
Parameters:
property - The property for which to retrieve the setter name.
Returns:
The name of the setter method for the given property.

getBooleanGetterName

public static java.lang.String getBooleanGetterName(java.lang.String property)
This method complements the functionality of getGetterName(String) for boolen properties, where the getter method start with the string "is" instead of "get".

Parameters:
property - The boolean property for which to retrieve the setter name.
Returns:
The name of the setter method for the given property.

getPropertyFromGetterName

public static java.lang.String getPropertyFromGetterName(java.lang.String getterName)
Returns the property name of a given getter method name.

Parameters:
getterName - The name of the getter function.
Returns:
The associated property name or null, if the function name is not a valid getter name.
See Also:
getBooleanPropertyFromGetterName(String)

getBooleanPropertyFromGetterName

public static java.lang.String getBooleanPropertyFromGetterName(java.lang.String getterName)
Returns the property name of a given getter method name for boolean fields. This method complements the functionality of getGetterName(String) for boolen properties, where the getter method start with the string "is" instead of "get".

Parameters:
getterName - The name of the getter function.
Returns:
The associated property name or null, if the function name is not a valid getter name.

getPropertyFromSetterName

public static java.lang.String getPropertyFromSetterName(java.lang.String setterName)
Returns the property name of a given setter method name.

Parameters:
getterName - The name of the setter function.
Returns:
The associated property name or null, if the function name is not a valid setter name.


Copyright © 2009. All Rights Reserved.