public final class ValidatorFactory
extends java.lang.Object
This class uses a fluent style API.
| Constructor and Description |
|---|
ValidatorFactory()
Constructs a new factory.
|
ValidatorFactory(CompileOptions options)
Constructs a new factory with the specified compile options.
|
| Modifier and Type | Method and Description |
|---|---|
ValidatorFactory |
debug(DebugOutput debug)
Enable debug mode to save a copy of the generated stylesheet when it is generated.
|
ValidatorFactory |
disableDebug()
Disable debug mode.
|
ValidatorFactory |
enableDebug()
Enable debug mode to save a copy of the generated stylesheet to a file for debugging.
|
ValidatorFactory |
errorListener(javax.xml.transform.ErrorListener listener)
Set the error event listener for the ValidatorFactory, which is used for the processing of the
Schematron schema, not for the Schematron validation itself.
|
javax.xml.transform.ErrorListener |
getErrorListener()
Get the error event handler for this factory.
|
CompileOptions |
getOptions()
Deprecated.
|
Validator |
newValidator(java.io.File schema)
Process the specified schema into a Validator object.
|
Validator |
newValidator(java.io.File schema,
java.lang.String phase)
Process the specified schema into a Validator object.
|
Validator |
newValidator(javax.xml.transform.Source schema)
Process the specified schema into a Validator object.
|
Validator |
newValidator(javax.xml.transform.Source schema,
java.lang.String phase)
Process the specified schema into a Validator object.
|
CompileOptions |
options() |
ValidatorFactory |
options(CompileOptions options) |
ValidatorFactory |
resolver(java.lang.Class<javax.xml.transform.URIResolver> resolver)
Set the class name of the resolver to use, overriding built-in Apache resolver
|
public ValidatorFactory()
public ValidatorFactory(CompileOptions options)
public ValidatorFactory options(CompileOptions options)
@Deprecated public CompileOptions getOptions()
public CompileOptions options()
public ValidatorFactory errorListener(javax.xml.transform.ErrorListener listener)
listener - The error listener.public javax.xml.transform.ErrorListener getErrorListener()
null.public ValidatorFactory enableDebug()
This method assigned a default DebugOutput implementation. To specify your
own use the debug(DebugOutput) method.
public ValidatorFactory disableDebug()
public ValidatorFactory debug(DebugOutput debug)
public ValidatorFactory resolver(java.lang.Class<javax.xml.transform.URIResolver> resolver)
public Validator newValidator(java.io.File schema) throws SchematronException
schema - The Schematron schema to use.SchematronExceptionpublic Validator newValidator(java.io.File schema, java.lang.String phase) throws SchematronException
schema - The Schematron schema to use.SchematronExceptionpublic Validator newValidator(javax.xml.transform.Source schema) throws SchematronException
schema - The Schematron schema to use.SchematronException - Will wrap any exception occurring while attempting to instantiate a validator.public Validator newValidator(javax.xml.transform.Source schema, java.lang.String phase) throws SchematronException
schema - The Schematron schema to use.phase - The phase for this schema.SchematronException - Will wrap any exception occurring while attempting to instantiate a validator.