Interface Validator<V>

    • Field Detail

      • INVALID_VALUE_MESSAGE_PROPERTY

        static final java.lang.String INVALID_VALUE_MESSAGE_PROPERTY
        The invalid value message bound property.
      • VALUE_REQUIRED_MESSAGE_PROPERTY

        static final java.lang.String VALUE_REQUIRED_MESSAGE_PROPERTY
        The value required message bound property.
      • VALUE_REQUIRED_PROPERTY

        static final java.lang.String VALUE_REQUIRED_PROPERTY
        The value required bound property.
    • Method Detail

      • getInvalidValueMessage

        java.lang.String getInvalidValueMessage()
        Returns:
        The invalid value message text, which may include a resource reference.
      • setInvalidValueMessage

        void setInvalidValueMessage​(java.lang.String newInvalidValueMessage)
        Sets the text of the invalid value message. This is a bound property.
        Parameters:
        newInvalidValueMessage - The new text of the invalid value message, which may include a resource reference.
        Throws:
        java.lang.NullPointerException - if the given message is null.
        See Also:
        INVALID_VALUE_MESSAGE_PROPERTY
      • getValueRequiredMessage

        java.lang.String getValueRequiredMessage()
        Returns:
        The value required message text, which may include a resource reference.
      • setValueRequiredMessage

        void setValueRequiredMessage​(java.lang.String newValueRequiredMessage)
        Sets the text of the value required message. This is a bound property.
        Parameters:
        newValueRequiredMessage - The new text of the value required message, which may include a resource reference..
        Throws:
        java.lang.NullPointerException - if the given message is null.
        See Also:
        VALUE_REQUIRED_MESSAGE_PROPERTY
      • getSession

        GuiseSession getSession()
        Returns:
        The Guise session that owns this validator.
      • isValid

        boolean isValid​(V value)
        Determines whether a given value is valid. This convenience version calls validate(Object), returning false only if an exception is thrown. Although this method may be overridden to provide optimized fast-fail determinations, adding new logic to this method cannot be used in place of overriding validate(Object).
        Parameters:
        value - The value to validate.
        Returns:
        true if a value is given and the value is valid; or a value is not required, else false.