|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.octagroup.foregej.java.util.BeansUtil
Class that contains functionality associated with the beans specification.
Constructor Summary | |
BeansUtil()
|
Method Summary | |
static java.lang.String |
getPropertyName(AST_METHOD_DEF method)
Returns the property name of the supplied method. |
static java.lang.String |
getPropertyName(java.lang.String methodName)
Returns the property name of the supplied method name. |
static AST_TYPE |
getPropertyType(AST_METHOD_DEF method)
Returns the type of property that this method accepts or returns. |
static java.lang.String |
getSetterArgumentName(AST_METHOD_DEF setter)
Returns the name of the argument for the setter method. |
static AST_METHOD_DEF |
getter2Setter(AST_METHOD_DEF getter)
Performs a deep copy of the getter and converts it to a setter. |
static boolean |
isGetter(AST_METHOD_DEF method)
Returns true if the suplied method is a getter method. |
static boolean |
isGetter(java.lang.String methodName)
Returns true if the suplied name is a getter method. |
static boolean |
isGetterOrSetter(AST_METHOD_DEF method)
Returns true if the method is a getter or setter. |
static boolean |
isGetterOrSetter(java.lang.String methodName)
Returns true if the method name is a getter or setter. |
static boolean |
isSetter(AST_METHOD_DEF method)
Returns true if the suplied method is a setter method. |
static boolean |
isSetter(java.lang.String methodName)
Returns true if the suplied name is a setter method. |
static java.lang.String |
property2Method(java.lang.String property)
Converts a property name to a method name. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BeansUtil()
Method Detail |
public static java.lang.String getPropertyName(AST_METHOD_DEF method)
This method extracts the name of the method and returns the property name for that. First it checks if it is a getter / setter.
method
- the method name to determine the property name from.public static java.lang.String getPropertyName(java.lang.String methodName)
This method
methodName
- the method name to determine the property name
from.public static AST_METHOD_DEF getter2Setter(AST_METHOD_DEF getter)
Since we perform a deep copy the body of the getter will also be copied.
getter
- public static boolean isGetterOrSetter(AST_METHOD_DEF method)
method
- the method to switch on.public static boolean isGetterOrSetter(java.lang.String methodName)
methodName
- the method name to switch on.public static boolean isGetter(AST_METHOD_DEF method)
method
- the methodpublic static boolean isGetter(java.lang.String methodName)
methodName
- the name of the methodpublic static boolean isSetter(AST_METHOD_DEF method)
method
- the methodpublic static boolean isSetter(java.lang.String methodName)
methodName
- the name of the methodpublic static java.lang.String property2Method(java.lang.String property)
Usually this involves converting the first character to upper case.
property
- public static AST_TYPE getPropertyType(AST_METHOD_DEF method)
The type is determined from the return value if this is a getter and from the argument if this is a setter.
method
- public static java.lang.String getSetterArgumentName(AST_METHOD_DEF setter)
setter
- the method to get the setter argument from.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |