Top Description Inners Methods
jakarta.faces.validator

public @Interface FacesValidator

extends Annotation
Known Direct Implementers
jakarta.faces.validator.FacesValidator.Literal
Annotations
@Retention:RUNTIME
@Target:TYPE, FIELD, METHOD, PARAMETER
@Inherited
@Qualifier
Static Imports
java.lang.annotation.ElementType.FIELD, .ElementType.METHOD, .ElementType.PARAMETER, .ElementType.TYPE, .RetentionPolicy.RUNTIME

The presence of this annotation on a class automatically registers the class with the runtime as a Validator. The value of the value attribute is taken to be the validator-id and the fully qualified class name of the class to which this annotation is attached is taken to be the validator-class. The implementation must guarantee that for each class annotated with * FacesValidator, found with the algorithm in section 11.4 "Annotations that correspond to and may take the place of entries in the Application Configuration Resources" of the Jakarta Faces Specification Document, jakarta.faces.application.Application#addValidator(java.lang.String, java.lang.String) is called, passing the derived validator-id as the first argument and the derived validator-class as the second argument. The implementation must guarantee that all such calls to addValidator() happen during application startup time and before any requests are serviced.

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
FacesValidator.Literal

Supports inline instantiation of the FacesValidator qualifier.

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

whether or not this is a default validator
isDefault
()

If true, the validator id for this annotation is added to the list of default validators by a call to jakarta.faces.application.Application#addDefaultValidatorId.

public boolean

Returns:

true if CDI managed, false otherwise.
managed
()

The value of this annotation attribute is taken to be an indicator that flags whether or not the given validator is a CDI managed validator.

public String

Returns:

the validator-id
value
()

The value of this annotation attribute is taken to be the validator-id with which instances of this class of component can be instantiated by calling jakarta.faces.application.Application#createValidator(java.lang.String).

Inherited from java.lang.annotation.Annotation:
annotationTypeequalshashCodetoString

Method Detail

isDefaultback to summary
public boolean isDefault()

If true, the validator id for this annotation is added to the list of default validators by a call to jakarta.faces.application.Application#addDefaultValidatorId.

Returns:boolean

whether or not this is a default validator

managedback to summary
public boolean managed()

The value of this annotation attribute is taken to be an indicator that flags whether or not the given validator is a CDI managed validator.

Returns:boolean

true if CDI managed, false otherwise.

valueback to summary
public String value()

The value of this annotation attribute is taken to be the validator-id with which instances of this class of component can be instantiated by calling jakarta.faces.application.Application#createValidator(java.lang.String). If no value is specified, or the value is null, the value is taken to be the return of calling getSimpleName on the class to which this annotation is attached and lowercasing the first character. If more than one validator with this derived name is found, the results are undefined.

Returns:String

the validator-id

jakarta.faces.validator back to summary

public final Class FacesValidator.Literal

extends AnnotationLiteral<FacesValidator>
implements FacesValidator
Class Inheritance
All Implemented Interfaces
jakarta.faces.validator.FacesValidator, java.lang.annotation.Annotation

Supports inline instantiation of the FacesValidator qualifier.

Since
4.0

Field Summary

Modifier and TypeField and Description
public static final FacesValidator.Literal
INSTANCE

Instance of the FacesValidator qualifier.

private final boolean
private final boolean
private static final long
private final String

Constructor Summary

AccessConstructor and Description
private
Literal(String value, boolean isDefault, boolean managed)

Method Summary

Modifier and TypeMethod and Description
public boolean
isDefault()

Implements jakarta.faces.validator.FacesValidator.isDefault.

If true, the validator id for this annotation is added to the list of default validators by a call to jakarta.faces.application.Application#addDefaultValidatorId.

public boolean
managed()

Implements jakarta.faces.validator.FacesValidator.managed.

The value of this annotation attribute is taken to be an indicator that flags whether or not the given validator is a CDI managed validator.

public static FacesValidator.Literal
of(String value, boolean isDefault, boolean managed)

public String
value()

Implements jakarta.faces.validator.FacesValidator.value.

The value of this annotation attribute is taken to be the validator-id with which instances of this class of component can be instantiated by calling jakarta.faces.application.Application#createValidator(java.lang.String).

Inherited from jakarta.enterprise.util.AnnotationLiteral:
annotationTypeequalshashCodetoString

Field Detail

INSTANCEback to summary
public static final FacesValidator.Literal INSTANCE

Instance of the FacesValidator qualifier.

isDefaultback to summary
private final boolean isDefault
managedback to summary
private final boolean managed
serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.enterprise.util.AnnotationLiteral.serialVersionUID.

valueback to summary
private final String value

Constructor Detail

Literalback to summary
private Literal(String value, boolean isDefault, boolean managed)

Method Detail

isDefaultback to summary
public boolean isDefault()

Implements jakarta.faces.validator.FacesValidator.isDefault.

Doc from jakarta.faces.validator.FacesValidator.isDefault.

If true, the validator id for this annotation is added to the list of default validators by a call to jakarta.faces.application.Application#addDefaultValidatorId.

Returns:boolean

whether or not this is a default validator

Annotations
@Override
managedback to summary
public boolean managed()

Implements jakarta.faces.validator.FacesValidator.managed.

Doc from jakarta.faces.validator.FacesValidator.managed.

The value of this annotation attribute is taken to be an indicator that flags whether or not the given validator is a CDI managed validator.

Returns:boolean

true if CDI managed, false otherwise.

Annotations
@Override
ofback to summary
public static FacesValidator.Literal of(String value, boolean isDefault, boolean managed)
valueback to summary
public String value()

Implements jakarta.faces.validator.FacesValidator.value.

Doc from jakarta.faces.validator.FacesValidator.value.

The value of this annotation attribute is taken to be the validator-id with which instances of this class of component can be instantiated by calling jakarta.faces.application.Application#createValidator(java.lang.String). If no value is specified, or the value is null, the value is taken to be the return of calling getSimpleName on the class to which this annotation is attached and lowercasing the first character. If more than one validator with this derived name is found, the results are undefined.

Returns:String

the validator-id

Annotations
@Override