Package org.apache.pdfbox.preflight
Class ValidationResult.ValidationError
java.lang.Object
org.apache.pdfbox.preflight.ValidationResult.ValidationError
- Enclosing class:
- ValidationResult
This Class represents an error of validation. It contains an error code and an error explanation.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Throwable
The underlying cause if the ValidationError was caused by a Throwable.private String
Error detailsprivate String
Error identifier.private boolean
false: this error can't be ignored; true: this error can be ignoredprivate Integer
The page number on which the error happened, if known.private Throwable
Always record the place in the source code where the ValidationError was created, in case the ValidationError was not caused by a Throwable. -
Constructor Summary
ConstructorsConstructorDescriptionValidationError
(String errorCode) Create a validation error with the given error codeValidationError
(String errorCode, String details) Create a validation error with the given error code and the error explanation.ValidationError
(String errorCode, String details, Throwable cause) Create a validation error with the given error code and the error explanation. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getCause()
Get the underlying cause if the ValidationError was caused by a Throwable.Returns the page number, or null if not known.Get the place where the ValidationError was created, useful if the ValidationError was not caused by a Throwable.int
hashCode()
boolean
void
setDetails
(String details) Set the error explanationvoid
setPageNumber
(Integer pageNumber) Sets or resets the page number.void
setWarning
(boolean isWarning)
-
Field Details
-
errorCode
Error identifier. This error code can be used as identifier to internationalize the logging message using i18n. -
details
Error details -
isWarning
private boolean isWarningfalse: this error can't be ignored; true: this error can be ignored -
t
Always record the place in the source code where the ValidationError was created, in case the ValidationError was not caused by a Throwable. -
cause
The underlying cause if the ValidationError was caused by a Throwable. -
pageNumber
The page number on which the error happened, if known.
-
-
Constructor Details
-
ValidationError
Create a validation error with the given error code- Parameters:
errorCode
-
-
ValidationError
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
Create a validation error with the given error code and the error explanation.- Parameters:
errorCode
- the error codedetails
- the error explanation
-
-
Method Details
-
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
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
Returns the page number, or null if not known. -
setPageNumber
Sets or resets the page number.- Parameters:
pageNumber
- zero based page number or null if none is known.
-
getErrorCode
- Returns:
- the error code
-
getDetails
- Returns:
- the error explanation
-
setDetails
Set the error explanation- Parameters:
details
-
-
isWarning
public boolean isWarning() -
setWarning
public void setWarning(boolean isWarning) -
hashCode
public int hashCode() -
equals
-