Package org.jpedal.arlington.validate
Class PdfArlingtonValidator
java.lang.Object
org.jpedal.arlington.validate.PdfArlingtonValidator
Validates a PDF file against the Arlington Model.
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordThe result of validating a single PDF file. -
Constructor Summary
ConstructorsConstructorDescriptionPdfArlingtonValidator(Map<String, org.jpedal.arlington.model.ArlingtonObject> model, org.jpedal.io.writer.PdfFile info, org.jpedal.io.writer.PdfBuffer buffer, float pdfVersion) Create a new instance of the validator. -
Method Summary
Modifier and TypeMethodDescriptionReturns all issues collected so far.static voidEntry point that validates one or more PDF files against the Arlington Model.static PdfArlingtonValidator.ResultvalidateFile(byte[] pdfFile, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) Validate a single PDF file against the Arlington model.static PdfArlingtonValidator.ResultvalidateFile(byte[] pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) Validate a single PDF file against the Arlington model.static PdfArlingtonValidator.ResultvalidateFile(File pdfFile, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) Validate a single PDF file against the Arlington model.static PdfArlingtonValidator.ResultvalidateFile(File pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) Validate a single PDF file against the Arlington model.static PdfArlingtonValidator.ResultvalidateFile(InputStream pdfFile, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) Validate a single PDF file against the Arlington model.static PdfArlingtonValidator.ResultvalidateFile(InputStream pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) Validate a single PDF file against the Arlington model.voidvalidateObject(org.jpedal.io.writer.PdfObjectInt obj, String arlingtonObjectName, String path) Validate an arbitrary resolved object against a TSV definition.
-
Constructor Details
-
PdfArlingtonValidator
public PdfArlingtonValidator(Map<String, org.jpedal.arlington.model.ArlingtonObject> model, org.jpedal.io.writer.PdfFile info, org.jpedal.io.writer.PdfBuffer buffer, float pdfVersion) Create a new instance of the validator.- Parameters:
model- the Arlington Model to validate againstinfo- the currently loaded PDFbuffer- the buffer object for the currently loaded PDFpdfVersion- the currently loaded PDF version
-
-
Method Details
-
getIssues
Returns all issues collected so far..- Returns:
- all issues collected so far
-
validateObject
public void validateObject(org.jpedal.io.writer.PdfObjectInt obj, String arlingtonObjectName, String path) throws IOException Validate an arbitrary resolved object against a TSV definition.- Parameters:
obj- the resolved object to checkarlingtonObjectName- the Arlington TSV name to validate againstpath- a human readable path label- Throws:
IOException- if the underlying PDF cannot be read
-
main
Entry point that validates one or more PDF files against the Arlington Model.Usage:
java org.jpedal.arlington.validate.PdfArlingtonValidator --tsv <path-to-arlington-tsv-dir> [--level LEVEL] file1.pdf [file2.pdf ...]- Throws:
IOException
-
validateFile
public static PdfArlingtonValidator.Result validateFile(File pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file on diskmodel- the loaded Arlington model- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all
-
validateFile
public static PdfArlingtonValidator.Result validateFile(File pdfFile, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file on diskpassword- the password for the file, or null if it does not have onemodel- the loaded Arlington model- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all
-
validateFile
public static PdfArlingtonValidator.Result validateFile(byte[] pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file as a byte arraymodel- the loaded Arlington model- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all
-
validateFile
public static PdfArlingtonValidator.Result validateFile(byte[] pdfFile, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file as a byte arraypassword- the password for the file, or null if it does not have onemodel- the loaded Arlington model- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all
-
validateFile
public static PdfArlingtonValidator.Result validateFile(InputStream pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file on diskmodel- the loaded Arlington model- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all
-
validateFile
public static PdfArlingtonValidator.Result validateFile(InputStream pdfFile, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file from an InputStreampassword- the password for the file, or null if it does not have onemodel- the loaded Arlington model- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all
-