Top Description Inners Fields Constructors Methods
com.sun.faces.config

public Class Verifier

extends Object
Class Inheritance
Imports
java.lang.reflect.Constructor, .Modifier, java.util.ArrayList, .List, com.sun.faces.RIConstants, com.sun.faces.util.MessageUtils, .Util

This class backs the com.sun.faces.verifyObjects feature which provides basic validation of Components, Converters, and Validators.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static enum
Verifier.ObjectType

Represent the current Faces object types we validate.

Field Summary

Modifier and TypeField and Description
private final List<String>
messages

Container for any messages that may be queued.

private static final ThreadLocal<Verifier>
VERIFIER

Thread local to share the Verifier.

Constructor Summary

AccessConstructor and Description
pack-priv
Verifier()

Construct a new Verifier instance.

Method Summary

Modifier and TypeMethod and Description
public static Verifier

Returns:

a Verifier for the current web application if com.sun.faces.verifyObjects is enabled
getCurrentInstance
()

public List<String>

Returns:

a List of all failures found
getMessages
()

public boolean

Returns:

true if no messages were queued by the validation process
isApplicationValid
()

public static void
setCurrentInstance(Verifier
the Verifier for this web application
verifier
)

Set the Verifier for this thread (typically the same thread that is used to bootstrap the application).

public void
validateObject(Verifier.ObjectType
The type of Faces object we're validating
type
,
String
the class name of the Faces object we're validating
className
,
Class<?>
the type we expect className to either implement or extend
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
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

messagesback to summary
private final List<String> messages

Container for any messages that may be queued.

VERIFIERback to summary
private static final ThreadLocal<Verifier> VERIFIER

Thread local to share the Verifier.

Constructor Detail

Verifierback to summary
pack-priv Verifier()

Construct a new Verifier instance.

Method Detail

getCurrentInstanceback to summary
public static Verifier getCurrentInstance()
Returns:Verifier

a Verifier for the current web application if com.sun.faces.verifyObjects is enabled

getMessagesback to summary
public List<String> getMessages()
Returns:List<String>

a List of all failures found

isApplicationValidback to summary
public boolean isApplicationValid()
Returns:boolean

true if no messages were queued by the validation process

setCurrentInstanceback to summary
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:Verifier

the Verifier for this web application

validateObjectback to summary
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:Verifier.ObjectType

The type of Faces object we're validating

className:String

the class name of the Faces object we're validating

assignableTo:Class<?>

the type we expect className to either implement or extend

com.sun.faces.config back to summary

public final Enum Verifier.ObjectType

extends Enum<Verifier.ObjectType>
Class Inheritance

Represent the current Faces object types we validate.

Field Summary

Modifier and TypeField and Description
public static final Verifier.ObjectType
public static final Verifier.ObjectType
public static final Verifier.ObjectType
public static final Verifier.ObjectType

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public static Verifier.ObjectType
public static Verifier.ObjectType[]
Inherited from java.lang.Enum:
clonecompareTodescribeConstableequalsfinalizegetDeclaringClasshashCodenameordinaltoStringvalueOf

Field Detail

BEHAVIORback to summary
public static final Verifier.ObjectType BEHAVIOR
COMPONENTback to summary
public static final Verifier.ObjectType COMPONENT
CONVERTERback to summary
public static final Verifier.ObjectType CONVERTER
VALIDATORback to summary
public static final Verifier.ObjectType VALIDATOR

Constructor Detail

ObjectTypeback to summary
private ObjectType()

Method Detail

valueOfback to summary
public static Verifier.ObjectType valueOf(String name)
valuesback to summary
public static Verifier.ObjectType[] values()