Package com.helger.schematron.sch
Class SchematronResourceSCH
java.lang.Object
com.helger.schematron.AbstractSchematronResource
com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource<SchematronResourceSCH>
com.helger.schematron.sch.SchematronResourceSCH
- All Implemented Interfaces:
com.helger.commons.id.IHasID<String>,com.helger.commons.traits.IGenericImplTrait<SchematronResourceSCH>,com.helger.schematron.api.xslt.ISchematronXSLTBasedResource,com.helger.schematron.ISchematronResource
@NotThreadSafe
public class SchematronResourceSCH
extends com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource<SchematronResourceSCH>
A Schematron resource that is based on the original SCH file.
- Author:
- Philip Helger
-
Nested Class Summary
Nested classes/interfaces inherited from class com.helger.schematron.AbstractSchematronResource
com.helger.schematron.AbstractSchematronResource.NodeAndBaseURI -
Field Summary
Fields inherited from class com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource
DEFAULT_VALIDATE_SVRL, m_aCustomErrorListener, m_aCustomParameters, m_aCustomURIResolverFields inherited from class com.helger.schematron.AbstractSchematronResource
DEFAULT_USE_CACHE -
Constructor Summary
ConstructorsConstructorDescriptionSchematronResourceSCH(com.helger.commons.io.resource.IReadableResource aSCHResource) Constructor -
Method Summary
Modifier and TypeMethodDescriptionprotected final TransformerCustomizerSCHprotected TransformerCustomizerSCHstatic SchematronResourceSCHfromByteArray(byte[] aSchematron) Create a newSchematronResourceSCHfrom Schematron rules provided by an arbitrary byte array.
Important: in this case, no include resolution will be performed!!static SchematronResourceSCHfromClassPath(String sSCHPath) Create a new Schematron resource.static SchematronResourceSCHfromClassPath(String sSCHPath, ClassLoader aClassLoader) Create a new Schematron resource.static SchematronResourceSCHCreate a new Schematron resource.static SchematronResourceSCHCreate a new Schematron resource.static SchematronResourceSCHfromInputStream(String sResourceID, InputStream aSchematronIS) Create a newSchematronResourceSCHfrom Schematron rules provided by an arbitraryInputStream.
Important: in this case, no include resolution will be performed!!static SchematronResourceSCHfromString(String sSchematron, Charset aCharset) Create a newSchematronResourceSCHfrom Schematron rules provided by an arbitrary String.
Important: in this case, no include resolution will be performed!!static SchematronResourceSCHCreate a newSchematronResourceSCHfrom Schematron rules provided at a URLstatic SchematronResourceSCHCreate a newSchematronResourceSCHfrom Schematron rules provided at a URLfinal Stringfinal StringgetPhase()com.helger.schematron.api.xslt.ISchematronXSLTBasedProviderfinal booleanfinal voidsetForceCacheResult(boolean bForceCacheResult) Force the caching of results.final voidsetLanguageCode(String sLanguageCode) final voidMethods inherited from class com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource
applySchematronValidation, applySchematronValidationToSVRL, getErrorListener, getOutputValidityDeterminator, getSchematronValidity, getURIResolver, isValidateSVRL, isValidSchematron, parameters, setEntityResolver, setErrorListener, setOutputValidityDeterminator, setURIResolver, setValidateSVRL, toStringMethods inherited from class com.helger.schematron.AbstractSchematronResource
applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getAsNode, getAsNode, getEntityResolver, getID, getResource, getSchematronValidity, getSchematronValidity, internalCreateDOMReaderSettings, internalSetEntityResolver, isLenient, isUseCache, setLenient, setUseCacheMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.helger.commons.traits.IGenericImplTrait
thisAsTMethods inherited from interface com.helger.commons.id.IHasID
getIDMethods inherited from interface com.helger.schematron.ISchematronResource
applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getEntityResolver, getResource, getSchematronValidity, getSchematronValidity, isLenient, isUseCache, setLenient, setUseCacheMethods inherited from interface com.helger.schematron.api.xslt.ISchematronXSLTBasedResource
setAllowForeignElements
-
Constructor Details
-
SchematronResourceSCH
public SchematronResourceSCH(@Nonnull com.helger.commons.io.resource.IReadableResource aSCHResource) Constructor- Parameters:
aSCHResource- The Schematron resource. May not benull.
-
-
Method Details
-
getPhase
-
setPhase
-
getLanguageCode
-
setLanguageCode
-
isForceCacheResult
public final boolean isForceCacheResult()- Returns:
trueif internal caching of the result should be forced,falseif not.- Since:
- 5.2.1
-
setForceCacheResult
public final void setForceCacheResult(boolean bForceCacheResult) Force the caching of results. This only applies when Schematron to XSLT conversion is performed.- Parameters:
bForceCacheResult-trueto force result caching,falseto cache only if no parameters are present.- Since:
- 5.2.1
-
applyDefaultValuesOnTransformerCustomizer
@Nonnull protected final TransformerCustomizerSCH applyDefaultValuesOnTransformerCustomizer(@Nonnull TransformerCustomizerSCH aTC) -
createTransformerCustomizer
-
getXSLTProvider
- Specified by:
getXSLTProviderin classcom.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource<SchematronResourceSCH>
-
fromClassPath
Create a new Schematron resource.- Parameters:
sSCHPath- The classpath relative path to the Schematron file. May neither benullnor empty.- Returns:
- Never
null.
-
fromClassPath
@Nonnull public static SchematronResourceSCH fromClassPath(@Nonnull @Nonempty String sSCHPath, @Nullable ClassLoader aClassLoader) Create a new Schematron resource.- Parameters:
sSCHPath- The classpath relative path to the Schematron file. May neither benullnor empty.aClassLoader- The class loader to be used to retrieve the classpath resource. May benull.- Returns:
- Never
null. - Since:
- 6.0.4
-
fromFile
Create a new Schematron resource.- Parameters:
sSCHPath- The file system path to the Schematron file. May neither benullnor empty.- Returns:
- Never
null.
-
fromFile
Create a new Schematron resource.- Parameters:
aSCHFile- The Schematron file. May not benull.- Returns:
- Never
null.
-
fromURL
@Nonnull public static SchematronResourceSCH fromURL(@Nonnull @Nonempty String sSCHURL) throws MalformedURLException Create a newSchematronResourceSCHfrom Schematron rules provided at a URL- Parameters:
sSCHURL- The URL to the Schematron rules. May neither benullnor empty.- Returns:
- Never
null. - Throws:
MalformedURLException- In case an invalid URL is provided- Since:
- 6.2.6
-
fromURL
Create a newSchematronResourceSCHfrom Schematron rules provided at a URL- Parameters:
aSCHURL- The URL to the Schematron rules. May not benull.- Returns:
- Never
null. - Since:
- 6.2.6
-
fromInputStream
@Nonnull public static SchematronResourceSCH fromInputStream(@Nonnull @Nonempty String sResourceID, @Nonnull InputStream aSchematronIS) Create a newSchematronResourceSCHfrom Schematron rules provided by an arbitraryInputStream.
Important: in this case, no include resolution will be performed!!- Parameters:
sResourceID- Resource ID to be used as the cache key. Should neither benullnor empty.aSchematronIS- TheInputStreamto read the Schematron rules from. May not benull.- Returns:
- Never
null. - Since:
- 6.2.6
-
fromByteArray
Create a newSchematronResourceSCHfrom Schematron rules provided by an arbitrary byte array.
Important: in this case, no include resolution will be performed!!- Parameters:
aSchematron- The byte array representing the Schematron. May not benull.- Returns:
- Never
null. - Since:
- 6.2.6
-
fromString
@Nonnull public static SchematronResourceSCH fromString(@Nonnull String sSchematron, @Nonnull Charset aCharset) Create a newSchematronResourceSCHfrom Schematron rules provided by an arbitrary String.
Important: in this case, no include resolution will be performed!!- Parameters:
sSchematron- The String representing the Schematron. May not benull.aCharset- The charset to be used to convert the String to a byte array.- Returns:
- Never
null. - Since:
- 6.2.6
-