站内搜索: 请输入搜索关键词
当前页面: 在线文档首页 > JBOSS Portal 2.4 API 英文版文档

ValidatorException - JBOSS Portal 2.4 API 英文版文档


javax.portlet
Class ValidatorException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjavax.portlet.PortletException
              extended byjavax.portlet.ValidatorException
All Implemented Interfaces:
java.io.Serializable

public class ValidatorException
extends PortletException

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

See Also:
Serialized Form

Constructor Summary
ValidatorException(java.lang.String text, java.util.Collection failedKeys)
          Constructs a new validator exception with the given text.
ValidatorException(java.lang.String text, java.lang.Throwable cause, java.util.Collection failedKeys)
          Constructs a new portlet validator exception.
ValidatorException(java.lang.Throwable cause, java.util.Collection failedKeys)
          Constructs a new portlet validator exception when the portlet needs to throw an exception.
 
Method Summary
 java.util.Enumeration getFailedKeys()
          Returns the keys that failed the validation.
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ValidatorException

public ValidatorException(java.lang.String text,
                          java.util.Collection 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 - the exception text
failedKeys - keys that failed the validation; may be null

ValidatorException

public ValidatorException(java.lang.String text,
                          java.lang.Throwable cause,
                          java.util.Collection 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 - the exception text
cause - the root cause
failedKeys - keys that failed the validation; may be null

ValidatorException

public ValidatorException(java.lang.Throwable cause,
                          java.util.Collection 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 - the root cause
failedKeys - keys that failed the validation; may be null
Method Detail

getFailedKeys

public java.util.Enumeration 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:
the keys that failed validation, or an empty Enumeration if no failed keys are available.