Package eu.woolplatform.utils.beans
Class PropertyScanner
- java.lang.Object
-
- eu.woolplatform.utils.beans.PropertyScanner
-
public class PropertyScanner extends Object
This scanner can get the specification of a property in a JavaBeans-like class. It also searches superclasses. A property may be accessed by a public field or getter and setter methods. The possible getter and setter methods depend on the field type and name.- Property "prop", any type: getProp(), setProp()
- Property "prop", boolean: getProp(), isProp(), setProp()
- Property "isProp", boolean: getIsProp(), isIsProp(), isProp(), setIsProp(), setProp()
-
-
Constructor Summary
Constructors Constructor Description PropertyScanner()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static PropertySpecgetProperty(Class<?> clazz, String name)Gets a specification of the property with the specified name from the specified class.
-
-
-
Method Detail
-
getProperty
public static PropertySpec getProperty(Class<?> clazz, String name)
Gets a specification of the property with the specified name from the specified class.- Parameters:
clazz- the classname- the property name- Returns:
- the property specification
- Throws:
RuntimeException- if the property doesn't exist or can't be read or written
-
-