org.glassfish.jersey.server.validation
Class ValidationError

java.lang.Object
  extended by org.glassfish.jersey.server.validation.ValidationError

public final class ValidationError
extends Object

Default validation error entity to be included in Response.

Author:
Michal Gajdos (michal.gajdos at oracle.com)

Constructor Summary
ValidationError()
          Create a ValidationError instance.
ValidationError(String message, String messageTemplate, String path, String invalidValue)
          Create a ValidationError instance.
 
Method Summary
 String getInvalidValue()
          Returns the string representation of the value failing to pass the constraint.
 String getMessage()
          Return the interpolated error message for this validation error.
 String getMessageTemplate()
          Return the non-interpolated error message for this validation error.
 String getPath()
          Return the string representation of the property path to the value.
 void setInvalidValue(String invalidValue)
          Set the value failing to pass the constraint.
 void setMessage(String message)
          Return the interpolated error message for this validation error.
 void setMessageTemplate(String messageTemplate)
          Set the non-interpolated error message for this validation error.
 void setPath(String path)
          Set the string representation of the property path to the value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ValidationError

public ValidationError()
Create a ValidationError instance. Constructor for JAXB providers.


ValidationError

public ValidationError(String message,
                       String messageTemplate,
                       String path,
                       String invalidValue)
Create a ValidationError instance.

Parameters:
message - interpolated error message.
messageTemplate - non-interpolated error message.
path - property path.
invalidValue - value that failed to pass constraints.
Method Detail

getMessage

public String getMessage()
Return the interpolated error message for this validation error.

Returns:
the interpolated error message for this validation error.

setMessage

public void setMessage(String message)
Return the interpolated error message for this validation error.

Parameters:
message - the interpolated error message for this validation error.

getPath

public String getPath()
Return the string representation of the property path to the value.

Returns:
the string representation of the property path to the value.

setPath

public void setPath(String path)
Set the string representation of the property path to the value.

Parameters:
path - the string representation of the property path to the value.

getInvalidValue

public String getInvalidValue()
Returns the string representation of the value failing to pass the constraint.

Returns:
the value failing to pass the constraint.

setInvalidValue

public void setInvalidValue(String invalidValue)
Set the value failing to pass the constraint.

Parameters:
invalidValue - the value failing to pass the constraint.

getMessageTemplate

public String getMessageTemplate()
Return the non-interpolated error message for this validation error.

Returns:
the non-interpolated error message for this validation error.

setMessageTemplate

public void setMessageTemplate(String messageTemplate)
Set the non-interpolated error message for this validation error.

Parameters:
messageTemplate - the non-interpolated error message for this validation error.


Copyright © 2007-2014, Oracle and/or its affiliates. All Rights Reserved. Use is subject to license terms.