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 inResponseif JAX-B API is not available
-
-
Field Summary
Fields Modifier and Type Field Description protected StringinvalidValueprotected Stringmessageprotected StringmessageTemplateprotected Stringpath
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ValidationErrorDatacreateValidationError(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.StringgetInvalidValue()Returns the string representation of the value failing to pass the constraint.StringgetMessage()Return the interpolated error message for this validation error.StringgetMessageTemplate()Return the non-interpolated error message for this validation error.StringgetPath()Return the string representation of the property path to the value.voidsetInvalidValue(String invalidValue)Set the value failing to pass the constraint.voidsetMessage(String message)Return the interpolated error message for this validation error.voidsetMessageTemplate(String messageTemplate)Set the non-interpolated error message for this validation error.voidsetPath(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
-
-