Class Verifier


  • public class Verifier
    extends Object
    This class backs the com.sun.faces.verifyObjects feature which provides basic validation of Components, Converters, and Validators.
    • Method Detail

      • getCurrentInstance

        public static Verifier getCurrentInstance()
        Returns:
        a Verifier for the current web application if com.sun.faces.verifyObjects is enabled
      • setCurrentInstance

        public static void setCurrentInstance​(Verifier verifier)
        Set the Verifier for this thread (typically the same thread that is used to bootstrap the application).
        Parameters:
        verifier - the Verifier for this web application
      • isApplicationValid

        public boolean isApplicationValid()
        Returns:
        true if no messages were queued by the validation process
      • getMessages

        public List<String> getMessages()
        Returns:
        a List of all failures found
      • validateObject

        public void validateObject​(Verifier.ObjectType type,
                                   String className,
                                   Class<?> assignableTo)
        Validate the specified faces object by:
        • Ensure the class can be found and loaded
        • Ensure the object has a public, no-argument constructor
        • Ensure the object is an instance of the class represented by assignableTo
        If any of these tests fail, queue a message to be displayed at a later point in time.
        Parameters:
        type - The type of Faces object we're validating
        className - the class name of the Faces object we're validating
        assignableTo - the type we expect className to either implement or extend