Class 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 Detail

      • PropertyScanner

        public PropertyScanner()
    • 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 class
        name - the property name
        Returns:
        the property specification
        Throws:
        RuntimeException - if the property doesn't exist or can't be read or written