org.daisy.zedval.engine
Class RngSchematronTestProcessor

java.lang.Object
  extended byorg.daisy.zedval.engine.ZedTestProcessor
      extended byorg.daisy.zedval.engine.RngSchematronTestProcessor
All Implemented Interfaces:
org.xml.sax.ErrorHandler

public class RngSchematronTestProcessor
extends ZedTestProcessor
implements org.xml.sax.ErrorHandler

An RngSchematronTestProcessor object executes tests via RelaxNG schema validation

Author:
James Pritchett, Daniel Carlsson, Markus Gylling, Piotr Kiernicki

Constructor Summary
RngSchematronTestProcessor(java.lang.String id, java.lang.String l, java.util.LinkedHashMap tests, java.util.LinkedHashMap files, ZedContext c, java.lang.String schemaName, boolean useRng, boolean useSchematron)
           
 
Method Summary
 void error(org.xml.sax.SAXParseException e)
          Receives notification of a recoverable (probably validation) error
 void fatalError(org.xml.sax.SAXParseException e)
          Receives notification of a non-recoverable (probably well-formedness) error
 java.io.File getSchemaFile()
          Returns the schema file being used by this processor
 java.net.URL getSchemaUrl()
           
 boolean performTests()
          Validates all files against the schema
 java.lang.String toString()
           
 void warning(org.xml.sax.SAXParseException e)
          Receives notification of a warning
 
Methods inherited from class org.daisy.zedval.engine.ZedTestProcessor
getContext, getFilesTested, getId, getLabel, getTestsImplemented
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

RngSchematronTestProcessor

public RngSchematronTestProcessor(java.lang.String id,
                                  java.lang.String l,
                                  java.util.LinkedHashMap tests,
                                  java.util.LinkedHashMap files,
                                  ZedContext c,
                                  java.lang.String schemaName,
                                  boolean useRng,
                                  boolean useSchematron)
Parameters:
id - Id of this ZedTestProcessor (from processor map)
l - Name for this ZedTestProcessor
tests - LinkedHashMap of ZedTests that this ZedTestProcessor implements (key = id)
files - LinkedHashMap of ZedFiles upon which this ZedTestProcessor is to be invoked (key = absolute full path)
c - ZedContext for this run
schemaName - name of schema against which to validate
useRng - tells whether to validate against the RNG parts of the schema
useSchematron - tells whether to validate against the schematron parts of the schema
Method Detail

performTests

public boolean performTests()
Validates all files against the schema

Overrides:
performTests in class ZedTestProcessor
Returns:
TRUE if tests were performed on one or more files

getSchemaFile

public java.io.File getSchemaFile()
Returns the schema file being used by this processor

Returns:
File object for schema

getSchemaUrl

public java.net.URL getSchemaUrl()

error

public void error(org.xml.sax.SAXParseException e)
Receives notification of a recoverable (probably validation) error

Specified by:
error in interface org.xml.sax.ErrorHandler
Parameters:
e - The exception that represents the error

fatalError

public void fatalError(org.xml.sax.SAXParseException e)
Receives notification of a non-recoverable (probably well-formedness) error

Specified by:
fatalError in interface org.xml.sax.ErrorHandler
Parameters:
e - The exception that represents the error

warning

public void warning(org.xml.sax.SAXParseException e)
Receives notification of a warning

Specified by:
warning in interface org.xml.sax.ErrorHandler
Parameters:
e - The exception that represents the warning

toString

public java.lang.String toString()
Overrides:
toString in class ZedTestProcessor