Package com.helger.schematron.xslt
Class SchematronResourceXSLT
java.lang.Object
com.helger.schematron.AbstractSchematronResource
com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource<SchematronResourceXSLT>
com.helger.schematron.xslt.SchematronResourceXSLT
- All Implemented Interfaces:
com.helger.commons.id.IHasID<String>,com.helger.commons.traits.IGenericImplTrait<SchematronResourceXSLT>,com.helger.schematron.api.xslt.ISchematronXSLTBasedResource,com.helger.schematron.ISchematronResource
@NotThreadSafe
public class SchematronResourceXSLT
extends com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource<SchematronResourceXSLT>
A Schematron resource that is based on an existing, pre-compiled XSLT script.
- 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
ConstructorsConstructorDescriptionSchematronResourceXSLT(com.helger.commons.io.resource.IReadableResource aXSLTResource) Constructor -
Method Summary
Modifier and TypeMethodDescriptionstatic SchematronResourceXSLTfromByteArray(byte[] aXSLT) Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided by an arbitrary byte array.static SchematronResourceXSLTfromClassPath(String sXSLTPath) Create a newSchematronResourceXSLTresource.static SchematronResourceXSLTfromClassPath(String sXSLTPath, ClassLoader aClassLoader) Create a newSchematronResourceXSLTresource.static SchematronResourceXSLTCreate a newSchematronResourceXSLTresource.static SchematronResourceXSLTCreate a newSchematronResourceXSLTresource.static SchematronResourceXSLTfromInputStream(String sResourceID, InputStream aXSLTIS) Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided by an arbitraryInputStream.static SchematronResourceXSLTfromString(String sXSLT, Charset aCharset) Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided by an arbitrary String.static SchematronResourceXSLTCreate a newSchematronResourceXSLTfrom XSLT Schematron rules provided at a URLstatic SchematronResourceXSLTCreate a newSchematronResourceXSLTfrom XSLT Schematron rules provided at a URLcom.helger.schematron.api.xslt.ISchematronXSLTBasedProviderMethods inherited from class com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource
applySchematronValidation, applySchematronValidationToSVRL, getErrorListener, getSchematronValidity, getURIResolver, getXSLTValidator, isValidateSVRL, isValidSchematron, parameters, setEntityResolver, setErrorListener, setURIResolver, setValidateSVRL, setXSLTValidator, 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
-
SchematronResourceXSLT
public SchematronResourceXSLT(@Nonnull com.helger.commons.io.resource.IReadableResource aXSLTResource) Constructor- Parameters:
aXSLTResource- The XSLT resource. May not benull.
-
-
Method Details
-
getXSLTProvider
- Specified by:
getXSLTProviderin classcom.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource<SchematronResourceXSLT>
-
fromClassPath
Create a newSchematronResourceXSLTresource.- Parameters:
sXSLTPath- The classpath relative path to the Schematron XSLT file. May neither benullnor empty.- Returns:
- Never
null.
-
fromClassPath
@Nonnull public static SchematronResourceXSLT fromClassPath(@Nonnull @Nonempty String sXSLTPath, @Nullable ClassLoader aClassLoader) Create a newSchematronResourceXSLTresource.- Parameters:
sXSLTPath- The classpath relative path to the Schematron XSLT file. May neither benullnor empty.aClassLoader- The class loader to be used to retrieve the classpath resource. May benull.- Returns:
- Never
null.
-
fromFile
Create a newSchematronResourceXSLTresource.- Parameters:
sXSLTPath- The file system path to the Schematron XSLT file. May neither benullnor empty.- Returns:
- Never
null.
-
fromFile
Create a newSchematronResourceXSLTresource.- Parameters:
aXSLTFile- TheFileof the Schematron XSLT file. May not benull.- Returns:
- Never
null.
-
fromURL
@Nonnull public static SchematronResourceXSLT fromURL(@Nonnull @Nonempty String sXSLTURL) throws MalformedURLException Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided at a URL- Parameters:
sXSLTURL- The URL to the XSLT Schematron rules. May neither benullnor empty.- Returns:
- Never
null. - Throws:
MalformedURLException- In case an invalid URL is provided
-
fromURL
Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided at a URL- Parameters:
aXSLTURL- The URL to the XSLT Schematron rules. May not benull.- Returns:
- Never
null.
-
fromInputStream
@Nonnull public static SchematronResourceXSLT fromInputStream(@Nonnull @Nonempty String sResourceID, @Nonnull InputStream aXSLTIS) Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided by an arbitraryInputStream.- Parameters:
sResourceID- Resource ID to be used as the cache key. Should neither benullnor empty.aXSLTIS- TheInputStreamto read the XSLT Schematron rules from. May not benull.- Returns:
- Never
null.
-
fromByteArray
Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided by an arbitrary byte array.- Parameters:
aXSLT- The byte array representing the XSLT Schematron. May not benull.- Returns:
- Never
null.
-
fromString
@Nonnull public static SchematronResourceXSLT fromString(@Nonnull String sXSLT, @Nonnull Charset aCharset) Create a newSchematronResourceXSLTfrom XSLT Schematron rules provided by an arbitrary String.- Parameters:
sXSLT- The String representing the XSLT Schematron. May not benull.aCharset- The charset to be used to convert the String to a byte array.- Returns:
- Never
null.
-