Class AbstractFieldHandler

    • Field Detail

      • _properties

        protected java.util.Properties _properties
        Configuration that can be used by subclasses when needed.
    • Constructor Detail

      • AbstractFieldHandler

        public AbstractFieldHandler()
    • Method Detail

      • getFieldDescriptor

        protected final FieldDescriptor getFieldDescriptor()
        Returns the FieldDescriptor for the field that this handler is responsible for, or null if no FieldDescriptor has been set. This method is useful for implementations of the FieldHandler interface that wish to obtain information about the field in order to make the FieldHandler more generic and reusable, or simply for validation purposes.
        Specified by:
        getFieldDescriptor in class FieldHandlerFriend
        Returns:
        the FieldDescriptor, or null if none exists.
      • setFieldDescriptor

        public void setFieldDescriptor​(FieldDescriptor fieldDesc)
        Sets the FieldDescriptor that this FieldHander is responsibile for. By setting the FieldDescriptor, it allows the implementation of the FieldHandler methods to obtain information about the field itself. This allows a particular implementation to become more generic and reusable.
        Specified by:
        setFieldDescriptor in class FieldHandlerFriend
        Parameters:
        fieldDesc - the FieldDescriptor to set
      • hasValue

        public boolean hasValue​(java.lang.Object object)
        Returns true if the "handled" field has a value within the given object.

        By default this just checks for null. Normally this method is needed for checking if a value has been set via a call to the setValue method, or if the primitive value has been initialised by the JVM.

        This method should be overloaded for improved value checking.

        Returns:
        true if the given object has a value for the handled field