IMPLTYPE
- Implementation type@NotThreadSafe public abstract class AbstractSchematronXSLTBasedResource<IMPLTYPE extends AbstractSchematronXSLTBasedResource<IMPLTYPE>> extends AbstractSchematronResource implements ISchematronXSLTBasedResource, com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>
AbstractSchematronResource.NodeAndBaseURI
Modifier and Type | Field and Description |
---|---|
protected ErrorListener |
m_aCustomErrorListener |
protected com.helger.commons.collection.impl.ICommonsOrderedMap<String,Object> |
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,
String sBaseURI)
Apply the Schematron validation on the passed DOM node and return an SVRL
XML DOM Document.
|
SchematronOutputType |
applySchematronValidationToSVRL(Node aXMLSource,
String sBaseURI)
Apply the Schematron validation on the passed DOM Node and return a
SchematronOutputType object. |
ErrorListener |
getErrorListener() |
com.helger.commons.collection.impl.ICommonsOrderedMap<String,Object> |
getParameters()
Deprecated.
|
com.helger.commons.state.EValidity |
getSchematronValidity(Node aXMLNode,
String sBaseURI)
A method to check if the passed DOM node matches the Schematron rules or
not.
|
URIResolver |
getURIResolver() |
abstract ISchematronXSLTBasedProvider |
getXSLTProvider() |
ISchematronXSLTValidator |
getXSLTValidator() |
boolean |
hasParameters()
Deprecated.
|
boolean |
isValidSchematron() |
com.helger.commons.collection.impl.ICommonsOrderedMap<String,Object> |
parameters() |
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)
Deprecated.
|
IMPLTYPE |
setURIResolver(URIResolver aCustomURIResolver)
Set the
URIResolver to be used for reading Schematron. |
IMPLTYPE |
setXSLTValidator(ISchematronXSLTValidator aXSLTValidator)
Set the XSLT validator to be used.
|
String |
toString() |
applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getAsNode, getAsNode, getEntityResolver, getID, getResource, getSchematronValidity, getSchematronValidity, internalCreateDOMReaderSettings, internalSetEntityResolver, isUseCache, setUseCache
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
setAllowForeignElements
applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getEntityResolver, getResource, getSchematronValidity, getSchematronValidity, isUseCache, setUseCache
protected ErrorListener m_aCustomErrorListener
protected URIResolver m_aCustomURIResolver
public AbstractSchematronXSLTBasedResource(@Nonnull com.helger.commons.io.resource.IReadableResource aSCHResource)
@Nullable public ErrorListener getErrorListener()
getErrorListener
in interface ISchematronXSLTBasedResource
null
.@Nonnull public final IMPLTYPE setErrorListener(@Nullable ErrorListener aCustomErrorListener)
setErrorListener
in interface ISchematronXSLTBasedResource
aCustomErrorListener
- Error listener to use.@Nullable public URIResolver getURIResolver()
getURIResolver
in interface ISchematronXSLTBasedResource
URIResolver
to be used for reading the Schematron. May
be null
.@Nonnull public final IMPLTYPE setURIResolver(@Nullable URIResolver aCustomURIResolver)
ISchematronXSLTBasedResource
URIResolver
to be used for reading Schematron.setURIResolver
in interface ISchematronXSLTBasedResource
aCustomURIResolver
- The URIResolver
to use. May be null
,@Nonnull @ReturnsMutableObject public final com.helger.commons.collection.impl.ICommonsOrderedMap<String,Object> parameters()
parameters
in interface ISchematronXSLTBasedResource
null
.@Deprecated public boolean hasParameters()
@Nonnull @ReturnsMutableCopy @Deprecated public com.helger.commons.collection.impl.ICommonsOrderedMap<String,Object> getParameters()
@Nonnull @Deprecated public IMPLTYPE setParameters(@Nullable Map<String,?> aCustomParameters)
@Nonnull public final IMPLTYPE setEntityResolver(@Nullable EntityResolver aEntityResolver)
setEntityResolver
in interface ISchematronXSLTBasedResource
aEntityResolver
- The entity resolver to set. May be null
.@Nullable public abstract ISchematronXSLTBasedProvider getXSLTProvider()
null
.@Nonnull public ISchematronXSLTValidator getXSLTValidator()
getXSLTValidator
in interface ISchematronXSLTBasedResource
null
.@Nonnull public final IMPLTYPE setXSLTValidator(@Nonnull ISchematronXSLTValidator aXSLTValidator)
ISchematronXSLTBasedResource
setXSLTValidator
in interface ISchematronXSLTBasedResource
aXSLTValidator
- Validator instance to use. May not be null
.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, @Nullable String sBaseURI) throws Exception
ISchematronResource
getSchematronValidity
in interface ISchematronResource
aXMLNode
- The source DOM node to validate against the Schematron. May not be
null
.sBaseURI
- The Base URI of the XML document to be validated. May 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, @Nullable String sBaseURI) throws TransformerException
ISchematronResource
applySchematronValidation
in interface ISchematronResource
aXMLNode
- The DOM node to be validated via Schematron. May not be
null
.sBaseURI
- The Base URI of the XML document to be validated. May 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, @Nullable String sBaseURI) throws Exception
ISchematronResource
SchematronOutputType
object.applySchematronValidationToSVRL
in interface ISchematronResource
aXMLSource
- The DOM node to be validated via Schematron. May not be
null
.sBaseURI
- The Base URI of the XML document to be validated. May 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–2019 Philip Helger. All rights reserved.