Top Description Fields Constructors Methods
javax.portlet

public Class ValidatorException

extends PortletException
Class Inheritance
Imports
java.util.ArrayList, .Collection, .Collections, .Enumeration

The ValidatorException is thrown by the validate method of a PreferencesValidator when the validation of a preference failed.

Field Summary

Modifier and TypeField and Description
private transient ArrayList<String>
private static final long

Constructor Summary

AccessConstructor and Description
public
ValidatorException(String
the exception text
text
,
Collection<String>
keys that failed the validation; may be null
failedKeys
)

Constructs a new validator exception with the given text.

public
ValidatorException(String
the exception text
text
,
Throwable
the root cause
cause
,
Collection<String>
keys that failed the validation; may be null
failedKeys
)

Constructs a new portlet validator exception.

public
ValidatorException(Throwable
the root cause
cause
,
Collection<String>
keys that failed the validation; may be null
failedKeys
)

Constructs a new portlet validator exception when the portlet needs to throw an exception.

Method Summary

Modifier and TypeMethod and Description
public Enumeration<String>

Returns:

the keys that failed validation, or an empty Enumeration if no failed keys are available.
getFailedKeys
()

Returns the keys that failed the validation.

Field Detail

failedKeyVectorback to summary
private transient ArrayList<String> failedKeyVector
serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.portlet.PortletException.serialVersionUID.

Constructor Detail

ValidatorExceptionback to summary
public ValidatorException(String text, Collection<String> failedKeys)

Constructs a new validator exception with the given text. The portlet container may use the text write it to a log.

The collection of failed keys may contain all failed keys, only the first key that failed validation, or may be null.

Parameters
text:String

the exception text

failedKeys:Collection<String>

keys that failed the validation; may be null

ValidatorExceptionback to summary
public ValidatorException(String text, Throwable cause, Collection<String> failedKeys)

Constructs a new portlet validator exception. Used, when the portlet needs to do one of the following:

  • throw an exception
  • include a message about the "root cause" that interfered with its normal operation
  • include a description message

The Collection of failed keys may contain all failed keys, only the first key that failed validation, or may be null.

Parameters
text:String

the exception text

cause:Throwable

the root cause

failedKeys:Collection<String>

keys that failed the validation; may be null

ValidatorExceptionback to summary
public ValidatorException(Throwable cause, Collection<String> failedKeys)

Constructs a new portlet validator exception when the portlet needs to throw an exception. The exception message is based on the localized message of the underlying exception.

The Collection of failed keys may contain all failed keys, only the first key that failed validation, or may be null.

Parameters
cause:Throwable

the root cause

failedKeys:Collection<String>

keys that failed the validation; may be null

Method Detail

getFailedKeysback to summary
public Enumeration<String> getFailedKeys()

Returns the keys that failed the validation.

The Enumeration of failed keys may contain all failed keys, only the first key that failed validation, or an empty Enumeration if no failed keys are available.

Returns:Enumeration<String>

the keys that failed validation, or an empty Enumeration if no failed keys are available.