public class BeanUtilities
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
EMPTY |
private static java.lang.String |
GET |
private static java.lang.String |
IS |
| Constructor and Description |
|---|
BeanUtilities() |
| Modifier and Type | Method and Description |
|---|---|
private static java.lang.String |
firstUpper(java.lang.String s) |
static java.lang.Object |
getBeanPropertyValue(java.lang.reflect.Type requiredType,
java.lang.String attribute,
BeanInfo beanInfo)
Gets the value from the given attribute from the given bean
Safe to give both a bean-like map and a java bean
|
static java.lang.String |
getParameterNameFromField(java.lang.reflect.Field f,
boolean onlyDynamic)
Gets the parameter name from a field
|
static java.lang.String |
getParameterNameFromMethod(java.lang.reflect.Method m,
int paramIndex) |
static boolean |
hasDynamicParameter(java.lang.reflect.Method m) |
static boolean |
isEmpty(java.lang.String s) |
private static final java.lang.String GET
private static final java.lang.String IS
private static final java.lang.String EMPTY
private static java.lang.String firstUpper(java.lang.String s)
public static java.lang.Object getBeanPropertyValue(java.lang.reflect.Type requiredType,
java.lang.String attribute,
BeanInfo beanInfo)
requiredType - the type the attribute must beattribute - the attribute to get. The bean must have a method
with the name format getAttributebeanInfo - the bean infojava.lang.IllegalStateException - if unable to get the attributepublic static boolean isEmpty(java.lang.String s)
public static java.lang.String getParameterNameFromField(java.lang.reflect.Field f,
boolean onlyDynamic)
f - the field annotated with ConfiguredonlyDynamic - if true and the Configured annotation
is not Dynamicity.FULLY_DYNAMIC the null will be returnedConfigured annotation if non-empty
or the name of the field otherwisepublic static java.lang.String getParameterNameFromMethod(java.lang.reflect.Method m,
int paramIndex)
public static boolean hasDynamicParameter(java.lang.reflect.Method m)