public final class ReflectionHelper extends Object
Constructor and Description |
---|
ReflectionHelper() |
Modifier and Type | Method and Description |
---|---|
static String |
getPropertyName(Method method)
Returns the JavaBeans property name of the given method if it is a getter method.
|
static boolean |
propertyExists(Class<?> clazz,
String property,
ElementType elementType)
Whether the specified JavaBeans property exists on the given type or not.
|
public static boolean propertyExists(Class<?> clazz, String property, ElementType elementType)
clazz
- the type of interestproperty
- the JavaBeans property nameelementType
- the element type to check, must be either ElementType.FIELD
or
ElementType.METHOD
.true
if the specified property exists, false
otherwisepublic static String getPropertyName(Method method)
boolean
ormethod
- The method for which to get the property namenull
if the method is not a getter method according to
the JavaBeans standardCopyright © 2010-2013 Red Hat, Inc., Emmanuel Bernard and various contributors. All Rights Reserved.