Class PropertySpec


  • public class PropertySpec
    extends Object
    The specification of a property in a JavaBeans-like object. A property may be accessed by a public field or getter and setter methods. An instance of this class can be obtained from the PropertyScanner.
    • Constructor Detail

      • PropertySpec

        public PropertySpec()
    • Method Detail

      • getName

        public String getName()
        Returns the field name.
        Returns:
        the field name
      • setName

        public void setName​(String name)
        Sets the field name.
        Parameters:
        name - the field name
      • getField

        public Field getField()
        Returns the field. Note that it may not be public. See isPublic().
        Returns:
        the field
      • setField

        public void setField​(Field field)
        Sets the field.
        Parameters:
        field - the field
      • isPublic

        public boolean isPublic()
        Returns whether the field is public. If not, then use getGetMethod() and getSetMethod().
        Returns:
        true if the field is public
      • setPublic

        public void setPublic​(boolean isPublic)
        Sets whether the field is public. If not, you should set the get method and set method.
        Parameters:
        isPublic - true if the field is public
      • getGetMethod

        public Method getGetMethod()
        Returns the get method if the field is not public.
        Returns:
        the get method
      • setGetMethod

        public void setGetMethod​(Method getMethod)
        Sets the get method. This should be done if the field is not public.
        Parameters:
        getMethod - the get method
      • getSetMethod

        public Method getSetMethod()
        Returns the set method if the field is not public.
        Returns:
        the set method
      • setSetMethod

        public void setSetMethod​(Method setMethod)
        Sets the set method. This should be done if the field is not public.
        Parameters:
        setMethod - the set method