IMPLTYPE
- Implementation type@NotThreadSafe public abstract class AbstractSchematronXSLTBasedResource<IMPLTYPE extends AbstractSchematronXSLTBasedResource<IMPLTYPE>> extends AbstractSchematronResource implements com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>
Modifier and Type | Field and Description |
---|---|
protected ErrorListener |
m_aCustomErrorListener |
protected com.helger.commons.collection.ext.ICommonsOrderedMap<String,?> |
m_aCustomParameters |
protected URIResolver |
m_aCustomURIResolver |
Constructor and Description |
---|
AbstractSchematronXSLTBasedResource(com.helger.commons.io.resource.IReadableResource aSCHResource) |
Modifier and Type | Method and Description |
---|---|
Document |
applySchematronValidation(Node aXMLNode)
Apply the Schematron validation on the passed DOM node and return an SVRL
XML DOM Document.
|
SchematronOutputType |
applySchematronValidationToSVRL(Node aXMLSource)
Apply the Schematron validation on the passed DOM Node and return a
SchematronOutputType object. |
ErrorListener |
getErrorListener() |
com.helger.commons.collection.ext.ICommonsOrderedMap<String,?> |
getParameters() |
com.helger.commons.state.EValidity |
getSchematronValidity(Node aXMLNode)
A method to check if the passed DOM node matches the Schematron rules or
not.
|
URIResolver |
getURIResolver() |
abstract ISchematronXSLTBasedProvider |
getXSLTProvider() |
ISchematronXSLTValidator |
getXSLTValidator() |
boolean |
hasParameters() |
boolean |
isValidSchematron() |
IMPLTYPE |
setEntityResolver(EntityResolver aEntityResolver)
Set the XML entity resolver to be used when reading the XML to be
validated.
|
IMPLTYPE |
setErrorListener(ErrorListener aCustomErrorListener) |
IMPLTYPE |
setParameters(Map<String,?> aCustomParameters) |
IMPLTYPE |
setURIResolver(URIResolver aCustomURIResolver)
Set the
URIResolver to be used for reading Schematron. |
IMPLTYPE |
setXSLTValidator(ISchematronXSLTValidator aXSLTValidator) |
String |
toString() |
applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getAsNode, getAsNode, getEntityResolver, getID, getResource, getSchematronValidity, getSchematronValidity, internalCreateDOMReaderSettings, internalSetEntityResolver, isUseCache, setUseCache
protected ErrorListener m_aCustomErrorListener
protected URIResolver m_aCustomURIResolver
protected com.helger.commons.collection.ext.ICommonsOrderedMap<String,?> m_aCustomParameters
public AbstractSchematronXSLTBasedResource(@Nonnull com.helger.commons.io.resource.IReadableResource aSCHResource)
@Nullable public ErrorListener getErrorListener()
@Nonnull public IMPLTYPE setErrorListener(@Nullable ErrorListener aCustomErrorListener)
@Nullable public URIResolver getURIResolver()
URIResolver
to be used for reading the Schematron. May
be null
.@Nonnull public IMPLTYPE setURIResolver(@Nullable URIResolver aCustomURIResolver)
URIResolver
to be used for reading Schematron.aCustomURIResolver
- The URIResolver
to use. May be null
,public boolean hasParameters()
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.ext.ICommonsOrderedMap<String,?> getParameters()
@Nonnull public IMPLTYPE setEntityResolver(@Nullable EntityResolver aEntityResolver)
aEntityResolver
- The entity resolver to set. May be null
.@Nullable public abstract ISchematronXSLTBasedProvider getXSLTProvider()
null
.@Nonnull public ISchematronXSLTValidator getXSLTValidator()
null
.@Nonnull public IMPLTYPE setXSLTValidator(@Nonnull ISchematronXSLTValidator aXSLTValidator)
public final boolean isValidSchematron()
isValidSchematron
in interface ISchematronResource
true
if this Schematron can be used to validate XML
instances. If not, the Schematron is invalid and the log files must
be investigated.@Nonnull public com.helger.commons.state.EValidity getSchematronValidity(@Nonnull Node aXMLNode) throws Exception
ISchematronResource
getSchematronValidity
in interface ISchematronResource
aXMLNode
- The source DOM node to 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@Nullable public final Document applySchematronValidation(@Nonnull Node aXMLNode) throws TransformerException
ISchematronResource
applySchematronValidation
in interface ISchematronResource
aXMLNode
- The DOM node to be validated via Schematron. May not be
null
.null
if the passed resource does not exist or the non-
null
SVRL document otherwise.TransformerException
on how to convert the document
into a domain object
@Nullable public SchematronOutputType applySchematronValidationToSVRL(@Nonnull Node aXMLSource) throws Exception
ISchematronResource
SchematronOutputType
object.applySchematronValidationToSVRL
in interface ISchematronResource
aXMLSource
- The DOM node to be validated via Schematron. May not be
null
.null
when interpreting the Schematron failed.Exception
- In case the transformation somehow goes wrong.public String toString()
toString
in class AbstractSchematronResource
Copyright © 2014–2017 Philip Helger. All rights reserved.