Top Description Fields Constructors Methods
jakarta.faces.validator

public Class ValidatorException

extends FacesException
Class Inheritance
Imports
java.util.Collection, jakarta.faces.FacesException, jakarta.faces.application.FacesMessage

A ValidatorException is an exception thrown by the validate() method of a Validator to indicate that validation failed.

Field Summary

Modifier and TypeField and Description
private FacesMessage
private Collection<FacesMessage>
private static final long

Constructor Summary

AccessConstructor and Description
public
ValidatorException(FacesMessage
The message for this exception
message
)

Construct a new exception with the specified message and no root cause.

public
ValidatorException(Collection<FacesMessage>
the list of messages for this exception
messages
)

Allow this one exception to contain multiple messages.

public
ValidatorException(FacesMessage
The detail message for this exception
message
,
Throwable
The root cause for this exception
cause
)

Construct a new exception with the specified detail message and root cause.

public
ValidatorException(Collection<FacesMessage>
the detail messages for this exception
messages
,
Throwable
the root cause for this exception
cause
)

Allow this one exception to contain multiple messages, while passing on the root cause to the superclass

Method Summary

Modifier and TypeMethod and Description
public FacesMessage

Returns:

the message
getFacesMessage
()

Returns the FacesMessage associated with the exception.

public Collection<FacesMessage>

Returns:

the messages
getFacesMessages
()

If this instance was created with a constructor that takes Collection<FacesMessage>, this method returns the passed collection, otherwise this method returns null.

Inherited from jakarta.faces.FacesException:
getCause

Field Detail

messageback to summary
private FacesMessage message
messagesback to summary
private Collection<FacesMessage> messages
serialVersionUIDback to summary
private static final long serialVersionUID

Hides jakarta.faces.FacesException.serialVersionUID.

Constructor Detail

ValidatorExceptionback to summary
public ValidatorException(FacesMessage message)

Construct a new exception with the specified message and no root cause.

Parameters
message:FacesMessage

The message for this exception

ValidatorExceptionback to summary
public ValidatorException(Collection<FacesMessage> messages)

Allow this one exception to contain multiple messages.

Parameters
messages:Collection<FacesMessage>

the list of messages for this exception

Since
2.0
ValidatorExceptionback to summary
public ValidatorException(FacesMessage message, Throwable cause)

Construct a new exception with the specified detail message and root cause.

Parameters
message:FacesMessage

The detail message for this exception

cause:Throwable

The root cause for this exception

ValidatorExceptionback to summary
public ValidatorException(Collection<FacesMessage> messages, Throwable cause)

Allow this one exception to contain multiple messages, while passing on the root cause to the superclass

Parameters
messages:Collection<FacesMessage>

the detail messages for this exception

cause:Throwable

the root cause for this exception

Since
2.0

Method Detail

getFacesMessageback to summary
public FacesMessage getFacesMessage()

Returns the FacesMessage associated with the exception. If this instance was created with a constructor that takes Collection<FacesMessage>, this method returns the first message in the Collection

Returns:FacesMessage

the message

getFacesMessagesback to summary
public Collection<FacesMessage> getFacesMessages()

If this instance was created with a constructor that takes Collection<FacesMessage>, this method returns the passed collection, otherwise this method returns null.

Returns:Collection<FacesMessage>

the messages

Since
2.0