public class Verifier
extends java.lang.Object
This class backs the com.sun.faces.verifyObjects
feature which provides basic validation of Components,
Converters, and Validators.
Modifier and Type | Class and Description |
---|---|
static class |
Verifier.ObjectType
Represent the current Faces object types we validate.
|
Modifier and Type | Field and Description |
---|---|
private java.util.List<java.lang.String> |
messages
Container for any messages that may be queued.
|
private static java.lang.ThreadLocal<Verifier> |
VERIFIER
Thread local to share the
Verifier . |
Constructor and Description |
---|
Verifier()
Construct a new
Verifier instance. |
Modifier and Type | Method and Description |
---|---|
static Verifier |
getCurrentInstance() |
java.util.List<java.lang.String> |
getMessages() |
boolean |
isApplicationValid() |
static void |
setCurrentInstance(Verifier verifier)
Set the
Verifier for this thread (typically the
same thread that is used to bootstrap the application). |
void |
validateObject(Verifier.ObjectType type,
java.lang.String className,
java.lang.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. |
private static final java.lang.ThreadLocal<Verifier> VERIFIER
Verifier
.private java.util.List<java.lang.String> messages
public static Verifier getCurrentInstance()
Verifier
for the current web application
if com.sun.faces.verifyObjects
is enabledpublic static void setCurrentInstance(Verifier verifier)
Verifier
for this thread (typically the
same thread that is used to bootstrap the application).verifier
- the Verifier
for this web applicationpublic boolean isApplicationValid()
true
if no messages were queued by the
validation processpublic java.util.List<java.lang.String> getMessages()
List
of all failures foundpublic void validateObject(Verifier.ObjectType type, java.lang.String className, java.lang.Class<?> assignableTo)
assignableTo
type
- The type of Faces object we're validatingclassName
- the class name of the Faces object we're validatingassignableTo
- the type we expect className
to
either implement or extendCopyright © 2002-2013 Oracle America, Inc. All Rights Reserved.