Interface Accessor

    • Method Detail

      • getModelType

        Class<?> getModelType()
        Gets the model type in which the property is located
        Returns:
        model type
      • getName

        String getName()
        Gets the name of the property.
        Returns:
        property name
      • getAccessType

        AccessType getAccessType()
        Gets the access type.
        Returns:
        access type
      • getSupportedModes

        EnumSet<AccessMode> getSupportedModes()
        Gets the supported access modes of this accessor.
        Returns:
        set of supported access modes
      • canRead

        boolean canRead()
        Tests whether this accessor can be called to read (get) a value.

        This is basically shorthand for getAccessModes().contains(AccessMode.READ)

        Returns:
        true if this accessor supports AccessMode.READ.
      • canWrite

        boolean canWrite()
        Tests whether this accessor can be called to write (set) a value.

        This is basically shorthand for getAccessModes().contains(AccessMode.WRITE)

        Returns:
        true if this accessor supports AccessMode.WRITE.
      • getDataType

        Class<?> getDataType()
        Gets the declared data type of the property.
        Returns:
        data type
      • forSubtype

        Accessor forSubtype​(Class<?> subtype)
                     throws Exception
        Creates a copy of this accessor for a particular subtype of the base type.
        Parameters:
        subtype - the subject subtype
        Returns:
        accessor with same configuration, but with {!code subtype} as the new base type
        Throws:
        Exception