javax.ws.rs
Class ValidationException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by javax.ws.rs.WebApplicationException
                  extended by javax.ws.rs.ValidationException
All Implemented Interfaces:
java.io.Serializable

public class ValidationException
extends WebApplicationException

Exception class used by JAX-RS implementations to report constraint validations.

Since:
2.0
Author:
Santiago.PericasGeertsen ([email protected])
See Also:
Serialized Form

Constructor Summary
ValidationException()
          Construct a new instance with an HTTP status code of 500 and an empty list of violations.
ValidationException(int status)
          Construct a new instance with the specified HTTP status code and an empty list of violations.
ValidationException(int status, java.util.List<java.lang.String> violations)
          Construct a new instance with the specified HTTP status code and a list of violations.
ValidationException(Response.Status status)
          Construct a new instance with the specified HTTP status code and an empty list of violations.
ValidationException(Response.Status status, java.util.List<java.lang.String> violations)
          Construct a new instance with the specified HTTP status code and a list of violations.
 
Method Summary
 java.util.List<java.lang.String> getViolations()
          Get list of constraint validations.
 
Methods inherited from class javax.ws.rs.WebApplicationException
getResponse
 
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

ValidationException

public ValidationException()
Construct a new instance with an HTTP status code of 500 and an empty list of violations.


ValidationException

public ValidationException(int status)
Construct a new instance with the specified HTTP status code and an empty list of violations.

Parameters:
status - HTTP status code

ValidationException

public ValidationException(Response.Status status)
                    throws java.lang.IllegalArgumentException
Construct a new instance with the specified HTTP status code and an empty list of violations.

Parameters:
status - HTTP status code
Throws:
java.lang.IllegalArgumentException - if status is null

ValidationException

public ValidationException(int status,
                           java.util.List<java.lang.String> violations)
                    throws java.lang.IllegalArgumentException
Construct a new instance with the specified HTTP status code and a list of violations.

Parameters:
status - HTTP status code
violations - list of violations
Throws:
java.lang.IllegalArgumentException - if status or violations is null

ValidationException

public ValidationException(Response.Status status,
                           java.util.List<java.lang.String> violations)
                    throws java.lang.IllegalArgumentException
Construct a new instance with the specified HTTP status code and a list of violations.

Parameters:
status - HTTP status code
violations - list of violations
Throws:
java.lang.IllegalArgumentException - if status or violations is null
Method Detail

getViolations

public java.util.List<java.lang.String> getViolations()
Get list of constraint validations.

Returns:
list of constraint validations.


Copyright © 2007-2012 Oracle Corporation. All Rights Reserved. Use is subject to license terms.