Class ValidationErrorData
- java.lang.Object
-
- org.glassfish.jersey.server.validation.ValidationErrorData
-
- Direct Known Subclasses:
ValidationError
public class ValidationErrorData extends Object
Validation error entity to be included inResponse
if JAX-B API is not available
-
-
Field Summary
Fields Modifier and Type Field Description protected String
invalidValue
protected String
message
protected String
messageTemplate
protected String
path
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidationErrorData
createValidationError(String message, String messageTemplate, String path, String invalidValue)
A factory method that creates either JAX-B annotated data if JAX-B is available or POJO data otherwise.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.
-
-
-
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.
-
createValidationError
public static ValidationErrorData createValidationError(String message, String messageTemplate, String path, String invalidValue)
A factory method that creates either JAX-B annotated data if JAX-B is available or POJO data otherwise.- Parameters:
message
- interpolated error message.messageTemplate
- non-interpolated error message.path
- property path.invalidValue
- value that failed to pass constraints.- Returns:
- ValidationErrorData subclass or itself
-
-