public class BeanUtilities extends Object
Constructor and Description |
---|
BeanUtilities() |
Modifier and Type | Method and Description |
---|---|
static Object |
getBeanPropertyValue(Type requiredType,
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 String |
getParameterNameFromField(Field f,
boolean onlyDynamic)
Gets the parameter name from a field
|
static String |
getParameterNameFromMethod(Method m,
int paramIndex) |
static boolean |
hasDynamicParameter(Method m) |
static boolean |
isEmpty(String s) |
public static Object getBeanPropertyValue(Type requiredType, 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 infoIllegalStateException
- if unable to get the attributepublic static boolean isEmpty(String s)
public static String getParameterNameFromField(Field f, boolean onlyDynamic)
f
- the field annotated with Configured
onlyDynamic
- 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 String getParameterNameFromMethod(Method m, int paramIndex)
public static boolean hasDynamicParameter(Method m)
Copyright © 2009–2023 Oracle Corporation. All rights reserved.