Package org.apache.pdfbox.preflight
Class ValidationResult.ValidationError
- java.lang.Object
-
- org.apache.pdfbox.preflight.ValidationResult.ValidationError
-
- Enclosing class:
- ValidationResult
public static class ValidationResult.ValidationError extends java.lang.ObjectThis Class represents an error of validation. It contains an error code and an error explanation.
-
-
Constructor Summary
Constructors Constructor Description ValidationError(java.lang.String errorCode)Create a validation error with the given error codeValidationError(java.lang.String errorCode, java.lang.String details)Create a validation error with the given error code and the error explanation.ValidationError(java.lang.String errorCode, java.lang.String details, java.lang.Throwable cause)Create a validation error with the given error code and the error explanation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object o)java.lang.ThrowablegetCause()Get the underlying cause if the ValidationError was caused by a Throwable.java.lang.StringgetDetails()java.lang.StringgetErrorCode()java.lang.IntegergetPageNumber()Returns the page number, or null if not known.java.lang.ThrowablegetThrowable()Get the place where the ValidationError was created, useful if the ValidationError was not caused by a Throwable.inthashCode()booleanisWarning()voidsetDetails(java.lang.String details)Set the error explanationvoidsetPageNumber(java.lang.Integer pageNumber)Sets or resets the page number.voidsetWarning(boolean isWarning)
-
-
-
Constructor Detail
-
ValidationError
public ValidationError(java.lang.String errorCode)
Create a validation error with the given error code- Parameters:
errorCode-
-
ValidationError
public ValidationError(java.lang.String errorCode, java.lang.String details, java.lang.Throwable cause)Create a validation error with the given error code and the error explanation.- Parameters:
errorCode- the error codedetails- the error explanationcause- the error cause
-
ValidationError
public ValidationError(java.lang.String errorCode, java.lang.String details)Create a validation error with the given error code and the error explanation.- Parameters:
errorCode- the error codedetails- the error explanation
-
-
Method Detail
-
getThrowable
public java.lang.Throwable getThrowable()
Get the place where the ValidationError was created, useful if the ValidationError was not caused by a Throwable.- Returns:
- The place where the ValidationError was created.
-
getCause
public java.lang.Throwable getCause()
Get the underlying cause if the ValidationError was caused by a Throwable.- Returns:
- The underlying cause if the ValidationError was caused by a Throwable, or null if not.
-
getPageNumber
public java.lang.Integer getPageNumber()
Returns the page number, or null if not known.
-
setPageNumber
public void setPageNumber(java.lang.Integer pageNumber)
Sets or resets the page number.- Parameters:
pageNumber- zero based page number or null if none is known.
-
getErrorCode
public java.lang.String getErrorCode()
- Returns:
- the error code
-
getDetails
public java.lang.String getDetails()
- Returns:
- the error explanation
-
setDetails
public void setDetails(java.lang.String details)
Set the error explanation- Parameters:
details-
-
isWarning
public boolean isWarning()
-
setWarning
public void setWarning(boolean isWarning)
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
-