@NotThreadSafe public abstract class AbstractSchematronResource extends Object implements ISchematronResource
ISchematronResource
interface handling
the underlying resource and wrapping one method.Modifier and Type | Class and Description |
---|---|
protected static class |
AbstractSchematronResource.NodeAndBaseURI |
Constructor and Description |
---|
AbstractSchematronResource(com.helger.commons.io.resource.IReadableResource aResource)
Constructor
|
Modifier and Type | Method and Description |
---|---|
Document |
applySchematronValidation(com.helger.commons.io.IHasInputStream aXMLResource)
Apply the Schematron validation on the passed XML resource and return an
SVRL XML DOM Document.
|
Document |
applySchematronValidation(Source aXMLSource)
Apply the Schematron validation on the passed XML source and return an SVRL
XML DOM Document.
|
SchematronOutputType |
applySchematronValidationToSVRL(com.helger.commons.io.IHasInputStream aXMLResource)
Apply the Schematron validation on the passed XML resource and return a
SchematronOutputType object. |
SchematronOutputType |
applySchematronValidationToSVRL(Source aXMLSource)
Apply the Schematron validation on the passed XML source and return a
SchematronOutputType object. |
protected AbstractSchematronResource.NodeAndBaseURI |
getAsNode(com.helger.commons.io.IHasInputStream aXMLResource) |
protected Node |
getAsNode(Source aXMLSource) |
EntityResolver |
getEntityResolver() |
String |
getID() |
com.helger.commons.io.resource.IReadableResource |
getResource() |
com.helger.commons.state.EValidity |
getSchematronValidity(com.helger.commons.io.IHasInputStream aXMLResource)
A method to check if the passed XML DOM node matches the Schematron rules
or not.
|
com.helger.commons.state.EValidity |
getSchematronValidity(Source aXMLSource)
A method to check if the passed XML DOM node matches the Schematron rules
or not.
|
protected com.helger.xml.serialize.read.DOMReaderSettings |
internalCreateDOMReaderSettings() |
protected void |
internalSetEntityResolver(EntityResolver aEntityResolver)
Set the XML entity resolver to be used when reading the Schematron or the
XML to be validated.
|
boolean |
isUseCache() |
void |
setUseCache(boolean bUseCache)
Enable or disable caching.
|
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
applySchematronValidation, applySchematronValidationToSVRL, getSchematronValidity, isValidSchematron
public AbstractSchematronResource(@Nonnull com.helger.commons.io.resource.IReadableResource aResource)
aResource
- The Schematron resource. May not be null
.@Nonnull public final String getID()
getID
in interface com.helger.commons.id.IHasID<String>
@Nonnull public final com.helger.commons.io.resource.IReadableResource getResource()
getResource
in interface ISchematronResource
null
resource from which to read the
Schematron rules.public boolean isUseCache()
isUseCache
in interface ISchematronResource
true
to use caching, if applicable.public void setUseCache(boolean bUseCache)
ISchematronResource
setUseCache
in interface ISchematronResource
bUseCache
- true
to use the cache, false
to not use
it.@Nullable public EntityResolver getEntityResolver()
getEntityResolver
in interface ISchematronResource
null
.protected final void internalSetEntityResolver(@Nullable EntityResolver aEntityResolver)
aEntityResolver
- The entity resolver to set. May be null
.@Nonnull @ReturnsMutableCopy protected com.helger.xml.serialize.read.DOMReaderSettings internalCreateDOMReaderSettings()
DOMReaderSettings
to be used for reading the XML files
to be validated. This includes the EntityResolver
to be
used.getEntityResolver()
@Nullable protected AbstractSchematronResource.NodeAndBaseURI getAsNode(@Nonnull com.helger.commons.io.IHasInputStream aXMLResource) throws Exception
Exception
@Nullable protected Node getAsNode(@Nonnull Source aXMLSource) throws Exception
Exception
@Nonnull public com.helger.commons.state.EValidity getSchematronValidity(@Nonnull com.helger.commons.io.IHasInputStream aXMLResource) throws Exception
ISchematronResource
getSchematronValidity
in interface ISchematronResource
aXMLResource
- The source XML to read and validate against the Schematron. May not
be null
.EValidity.VALID
if the document is valid,
EValidity.INVALID
if it is invalid.Exception
- in case of a sever error validating the schema@Nonnull public com.helger.commons.state.EValidity getSchematronValidity(@Nonnull Source aXMLSource) throws Exception
ISchematronResource
getSchematronValidity
in interface ISchematronResource
aXMLSource
- The source XML to be validated against the Schematron. May not be
null
.EValidity.VALID
if the document is valid,
EValidity.INVALID
if it is invalid.Exception
- in case of a sever error validating the schema@Nullable public Document applySchematronValidation(@Nonnull com.helger.commons.io.IHasInputStream aXMLResource) throws Exception
ISchematronResource
applySchematronValidation
in interface ISchematronResource
aXMLResource
- The XML resource to be validated via Schematron. May not be
null
.null
if the passed resource does not exist or the non-
null
SVRL document otherwise.Exception
- In case the transformation somehow goes wrong.on how to convert the
document into a domain object
@Nullable public Document applySchematronValidation(@Nonnull Source aXMLSource) throws Exception
ISchematronResource
applySchematronValidation
in interface ISchematronResource
aXMLSource
- The XML source to be validated via Schematron. May not be
null
.null
when interpreting the Schematron failed.Exception
- In case the transformation somehow goes wrong.on how to convert the
document into a domain object
@Nullable public SchematronOutputType applySchematronValidationToSVRL(@Nonnull com.helger.commons.io.IHasInputStream aXMLResource) throws Exception
ISchematronResource
SchematronOutputType
object.applySchematronValidationToSVRL
in interface ISchematronResource
aXMLResource
- The XML resource to be validated via Schematron. May not be
null
.null
when interpreting the Schematron failed.Exception
- In case the transformation somehow goes wrong.@Nullable public SchematronOutputType applySchematronValidationToSVRL(@Nonnull Source aXMLSource) throws Exception
ISchematronResource
SchematronOutputType
object.applySchematronValidationToSVRL
in interface ISchematronResource
aXMLSource
- The XML source to be validated via Schematron. May not be
null
.null
when interpreting the Schematron failed.Exception
- In case the transformation somehow goes wrong.Copyright © 2014–2019 Philip Helger. All rights reserved.