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 the extensions currently assumed to be implemented by the PDF being validated.Returns 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, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) 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(byte[] pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) 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, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) Validate a single PDF file against the Arlington model, assuming a given set of Arlington extensions are implemented.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(File pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) Validate a single PDF file against the Arlington model, assuming a given set of Arlington extensions are implemented.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, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) 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.static PdfArlingtonValidator.ResultvalidateFile(InputStream pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) 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.withExtensions(Set<String> extensionNames) Specify which extensions should be assumed to be implemented by the PDF being validated.
-
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
-
withExtensions
Specify which extensions should be assumed to be implemented by the PDF being validated.- Parameters:
extensionNames- the names of the extensions to assume are implemented or null- Returns:
- itself
-
getExtensions
Returns the extensions currently assumed to be implemented by the PDF being validated.- Returns:
- the extensions currently assumed to be implemented by the PDF being validated
- See Also:
-
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(File pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) throws IOExceptionValidate a single PDF file against the Arlington model, assuming a given set of Arlington extensions are implemented.- Parameters:
pdfFile- the PDF file on diskmodel- the loaded Arlington modelextensions- the Arlington extensions to assume are implemented or null- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all- See Also:
-
validateFile
public static PdfArlingtonValidator.Result validateFile(File pdfFile, byte[] password, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) throws IOExceptionValidate a single PDF file against the Arlington model, assuming a given set of Arlington extensions are implemented.- Parameters:
pdfFile- the PDF file on diskpassword- the password for the file, or null if it does not have onemodel- the loaded Arlington modelextensions- the Arlington extensions to assume are implemented or null- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all- See Also:
-
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(byte[] pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file as a byte arraymodel- the loaded Arlington modelextensions- the Arlington extensions to assume are implemented or null- 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, Set<String> extensions) 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 modelextensions- the Arlington extensions to assume are implemented or null- 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
-
validateFile
public static PdfArlingtonValidator.Result validateFile(InputStream pdfFile, Map<String, org.jpedal.arlington.model.ArlingtonObject> model, Set<String> extensions) throws IOExceptionValidate a single PDF file against the Arlington model.- Parameters:
pdfFile- the PDF file on diskmodel- the loaded Arlington modelextensions- the Arlington extensions to assume are implemented or null- 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, Set<String> extensions) 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 modelextensions- the Arlington extensions to assume are implemented or null- Returns:
- the validation result (PDF version detected plus all issues found)
- Throws:
IOException- if the PDF cannot be opened/parsed at all
-