Top Constructors Methods
org.apache.pdfbox.preflight.parser

public Class XmlResultParser

extends Object
Class Inheritance
Imports
java.io.File, .IOException, .PrintWriter, .StringWriter, java.util.HashMap, .List, .Map, javax.xml.parsers.DocumentBuilderFactory, .ParserConfigurationException, org.apache.pdfbox.preflight.Format, .ValidationResult, .ValidationResult.ValidationError, org.w3c.dom.Document, .Element

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
private Map<ValidationResult.ValidationError, Integer>
protected void
createResponseWithError(Document rdocument, String pdfType, ValidationResult result, Element preflight)

private Element
generateFailureResponse(Document rdocument, String name, long duration, String pdfType, Exception e)

protected Element
generateResponseSkeleton(Document rdocument, String name, long duration)

public Element

Returns:

the validation results as XML
validate
(File
the file to be validated
file
)

Validate the given file.

public Element

Returns:

the validation results as XML
validate
(Document
XML based validation results of a former run
rdocument
,
File
the file to be validated
file
)

Validate the given file.

private Element
validate(File file, String name)

private Element
validate(Document rdocument, File file, String name)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

XmlResultParserback to summary
public XmlResultParser()

Method Detail

cleanErrorListback to summary
private Map<ValidationResult.ValidationError, Integer> cleanErrorList(List<ValidationResult.ValidationError> errors)
createResponseWithErrorback to summary
protected void createResponseWithError(Document rdocument, String pdfType, ValidationResult result, Element preflight)
generateFailureResponseback to summary
private Element generateFailureResponse(Document rdocument, String name, long duration, String pdfType, Exception e)
generateResponseSkeletonback to summary
protected Element generateResponseSkeleton(Document rdocument, String name, long duration)
validateback to summary
public Element validate(File file) throws IOException

Validate the given file.

Parameters
file:File

the file to be validated

Returns:Element

the validation results as XML

Exceptions
IOException:
if something went wrong
validateback to summary
public Element validate(Document rdocument, File file) throws IOException

Validate the given file. Add the validation results to the given XML tree.

Parameters
rdocument:Document

XML based validation results of a former run

file:File

the file to be validated

Returns:Element

the validation results as XML

Exceptions
IOException:
if something went wrong
validateback to summary
private Element validate(File file, String name) throws IOException
validateback to summary
private Element validate(Document rdocument, File file, String name) throws IOException