@NotThreadSafe public class SchematronResourcePure extends com.helger.schematron.AbstractSchematronResource
com.helger.schematron.sch.SchematronResourceSCH or
com.helger.schematron.xslt.SchematronResourceXSLT classes instead!| Constructor and Description |
|---|
SchematronResourcePure(com.helger.commons.io.resource.IReadableResource aResource) |
SchematronResourcePure(com.helger.commons.io.resource.IReadableResource aResource,
boolean bLenient) |
SchematronResourcePure(com.helger.commons.io.resource.IReadableResource aResource,
String sPhase,
IPSErrorHandler aErrorHandler) |
SchematronResourcePure(com.helger.commons.io.resource.IReadableResource aResource,
String sPhase,
IPSErrorHandler aErrorHandler,
boolean bLenient) |
| Modifier and Type | Method and Description |
|---|---|
Document |
applySchematronValidation(Node aXMLNode,
String sBaseURI) |
com.helger.schematron.svrl.jaxb.SchematronOutputType |
applySchematronValidationToSVRL(Node aXMLNode,
String sBaseURI)
The main method to convert a node to an SVRL document.
|
protected IPSBoundSchema |
createBoundSchema() |
static SchematronResourcePure |
fromByteArray(byte[] aSchematron)
Create a new
SchematronResourcePure from Schematron rules provided
by an arbitrary byte array. |
static SchematronResourcePure |
fromClassPath(String sSCHPath)
Create a new
SchematronResourcePure from a Classpath Schematron
rules |
static SchematronResourcePure |
fromClassPath(String sSCHPath,
ClassLoader aClassLoader)
Create a new
SchematronResourcePure from a Classpath Schematron
rules |
static SchematronResourcePure |
fromFile(File aSCHFile)
Create a new
SchematronResourcePure from file system Schematron
rules |
static SchematronResourcePure |
fromFile(String sSCHPath)
Create a new
SchematronResourcePure from file system Schematron
rules |
static SchematronResourcePure |
fromInputStream(InputStream aSchematronIS)
Deprecated.
since 6.2.5. Use
fromInputStream(String, InputStream)
instead |
static SchematronResourcePure |
fromInputStream(String sResourceID,
InputStream aSchematronIS)
Create a new
SchematronResourcePure from Schematron rules provided
by an arbitrary InputStream. |
static SchematronResourcePure |
fromSchema(PSSchema aSchematron)
Create a new
SchematronResourcePure from Schematron rules provided
by a domain model. |
static SchematronResourcePure |
fromString(String sSchematron,
Charset aCharset)
Create a new
SchematronResourcePure from Schematron rules provided
by an arbitrary String. |
static SchematronResourcePure |
fromURL(String sSCHURL)
Create a new
SchematronResourcePure from Schematron rules provided
at a URL |
static SchematronResourcePure |
fromURL(URL aSCHURL)
Create a new
SchematronResourcePure from Schematron rules provided
at a URL |
IPSValidationHandler |
getCustomValidationHandler() |
IPSErrorHandler |
getErrorHandler() |
XPathFunctionResolver |
getFunctionResolver() |
IPSBoundSchema |
getOrCreateBoundSchema()
Get the cached bound schema or create a new one.
|
String |
getPhase() |
com.helger.commons.state.EValidity |
getSchematronValidity(Node aXMLNode,
String sBaseURI) |
XPathVariableResolver |
getVariableResolver() |
boolean |
isValidSchematron() |
SchematronResourcePure |
setCustomValidationHandler(IPSValidationHandler aCustomValidationHandler)
Set the custom validation handler to be used during binding.
|
SchematronResourcePure |
setEntityResolver(EntityResolver aEntityResolver)
Set the XML entity resolver to be used when reading the Schematron or the
XML to be validated.
|
SchematronResourcePure |
setErrorHandler(IPSErrorHandler aErrorHandler)
Set the error handler to be used during binding.
|
SchematronResourcePure |
setPhase(String sPhase)
Set the Schematron phase to be evaluated.
|
SchematronResourcePure |
setXPathConfig(IXPathConfig aXPathConfig)
Set the
XPathConfig to be used in the XPath statements. |
void |
validateCompletely()
Use the internal error handler to validate all elements in the schematron.
|
void |
validateCompletely(IPSErrorHandler aErrorHandler)
Use the provided error handler to validate all elements in the schematron.
|
applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getAsNode, getAsNode, getEntityResolver, getID, getResource, getSchematronValidity, getSchematronValidity, internalCreateDOMReaderSettings, internalSetEntityResolver, isLenient, isUseCache, setLenient, setUseCache, toStringpublic SchematronResourcePure(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
public SchematronResourcePure(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, boolean bLenient)
public SchematronResourcePure(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, @Nullable String sPhase, @Nullable IPSErrorHandler aErrorHandler)
public SchematronResourcePure(@Nonnull com.helger.commons.io.resource.IReadableResource aResource, @Nullable String sPhase, @Nullable IPSErrorHandler aErrorHandler, boolean bLenient)
@Nonnull public final SchematronResourcePure setPhase(@Nullable String sPhase)
sPhase - The name of the phase to use. May be null which means
all phases.@Nullable public final IPSErrorHandler getErrorHandler()
null.@Nonnull public final SchematronResourcePure setErrorHandler(@Nullable IPSErrorHandler aErrorHandler)
aErrorHandler - The error handler. May be null.@Nullable public final IPSValidationHandler getCustomValidationHandler()
null.@Nonnull public final SchematronResourcePure setCustomValidationHandler(@Nullable IPSValidationHandler aCustomValidationHandler)
aCustomValidationHandler - The validation handler. May be null.@Nullable public final XPathVariableResolver getVariableResolver()
null.@Nullable public final XPathFunctionResolver getFunctionResolver()
null.@Nonnull public final SchematronResourcePure setXPathConfig(@Nonnull IXPathConfig aXPathConfig)
XPathConfig to be used in the XPath statements. This can
only be set before the Schematron is bound. If it is already bound an
exception is thrown to indicate the unnecessity of the call.aXPathConfig - The XPath config to set. May be null.@Nonnull public SchematronResourcePure setEntityResolver(@Nullable EntityResolver aEntityResolver)
aEntityResolver - The entity resolver to set. May be null.@Nonnull protected IPSBoundSchema createBoundSchema()
@Nonnull public IPSBoundSchema getOrCreateBoundSchema()
null.public boolean isValidSchematron()
public void validateCompletely()
public void validateCompletely(@Nonnull IPSErrorHandler aErrorHandler)
aErrorHandler - The error handler to use. May not be null.@Nonnull public com.helger.commons.state.EValidity getSchematronValidity(@Nonnull Node aXMLNode, @Nullable String sBaseURI) throws Exception
Exception@Nonnull public com.helger.schematron.svrl.jaxb.SchematronOutputType applySchematronValidationToSVRL(@Nonnull Node aXMLNode, @Nullable String sBaseURI) throws com.helger.schematron.SchematronException
aXMLNode - The source node to be validated. May not be null.sBaseURI - Base URI of the XML document to be validated. May be
null.null.com.helger.schematron.SchematronException - in case of a sever error validating the schema@Nullable public Document applySchematronValidation(@Nonnull Node aXMLNode, @Nullable String sBaseURI) throws Exception
Exception@Nonnull public static SchematronResourcePure fromClassPath(@Nonnull @Nonempty String sSCHPath)
SchematronResourcePure from a Classpath Schematron
rulessSCHPath - The classpath relative path to the Schematron rules.null.@Nonnull public static SchematronResourcePure fromClassPath(@Nonnull @Nonempty String sSCHPath, @Nullable ClassLoader aClassLoader)
SchematronResourcePure from a Classpath Schematron
rulessSCHPath - The classpath relative path to the Schematron rules.aClassLoader - The class loader to be used to retrieve the classpath resource. May
be null.null.@Nonnull public static SchematronResourcePure fromFile(@Nonnull @Nonempty String sSCHPath)
SchematronResourcePure from file system Schematron
rulessSCHPath - The file system path to the Schematron rules.null.@Nonnull public static SchematronResourcePure fromFile(@Nonnull File aSCHFile)
SchematronResourcePure from file system Schematron
rulesaSCHFile - The file system path to the Schematron rules.null.@Nonnull public static SchematronResourcePure fromURL(@Nonnull @Nonempty String sSCHURL) throws MalformedURLException
SchematronResourcePure from Schematron rules provided
at a URLsSCHURL - The URL to the Schematron rules. May neither be null
nor empty.null.MalformedURLException - In case an invalid URL is provided@Nonnull public static SchematronResourcePure fromURL(@Nonnull URL aSCHURL)
SchematronResourcePure from Schematron rules provided
at a URLaSCHURL - The URL to the Schematron rules. May not be null.null.@Deprecated @Nonnull public static SchematronResourcePure fromInputStream(@Nonnull InputStream aSchematronIS)
fromInputStream(String, InputStream)
insteadSchematronResourcePure from Schematron rules provided
by an arbitrary InputStream.aSchematronIS - The InputStream to read the Schematron rules from. May not
be null.null.@Nonnull public static SchematronResourcePure fromInputStream(@Nonnull @Nonempty String sResourceID, @Nonnull InputStream aSchematronIS)
SchematronResourcePure from Schematron rules provided
by an arbitrary InputStream.sResourceID - Resource ID to be used as the cache key. Should neither be
null nor empty.aSchematronIS - The InputStream to read the Schematron rules from. May not
be null.null.@Nonnull public static SchematronResourcePure fromByteArray(@Nonnull byte[] aSchematron)
SchematronResourcePure from Schematron rules provided
by an arbitrary byte array.aSchematron - The byte array representing the Schematron. May not be
null.null.@Nonnull public static SchematronResourcePure fromString(@Nonnull String sSchematron, @Nonnull Charset aCharset)
SchematronResourcePure from Schematron rules provided
by an arbitrary String.sSchematron - The String representing the Schematron. May not be null
.aCharset - The charset to be used to convert the String to a byte array.null.@Nonnull public static SchematronResourcePure fromSchema(@Nonnull PSSchema aSchematron)
SchematronResourcePure from Schematron rules provided
by a domain model.aSchematron - The Schematron model to be used. May not be null .null.Copyright © 2014–2021 Philip Helger. All rights reserved.