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_aCustomURIResolver

    Fields inherited from class com.helger.schematron.AbstractSchematronResource

    DEFAULT_USE_CACHE
  • Constructor Summary

    Constructors
    Constructor
    Description
    SchematronResourceSCH(com.helger.commons.io.resource.IReadableResource aSCHResource)
    Constructor
  • Method Summary

    Modifier and Type
    Method
    Description
    protected final TransformerCustomizerSCH
     
     
    fromByteArray(byte[] aSchematron)
    Create a new SchematronResourceSCH from Schematron rules provided by an arbitrary byte array.
    Important: in this case, no include resolution will be performed!!
    Create a new Schematron resource.
    fromClassPath(String sSCHPath, ClassLoader aClassLoader)
    Create a new Schematron resource.
    fromFile(File aSCHFile)
    Create a new Schematron resource.
    fromFile(String sSCHPath)
    Create a new Schematron resource.
    fromInputStream(String sResourceID, InputStream aSchematronIS)
    Create a new SchematronResourceSCH from Schematron rules provided by an arbitrary InputStream.
    Important: in this case, no include resolution will be performed!!
    fromString(String sSchematron, Charset aCharset)
    Create a new SchematronResourceSCH from Schematron rules provided by an arbitrary String.
    Important: in this case, no include resolution will be performed!!
    fromURL(String sSCHURL)
    Create a new SchematronResourceSCH from Schematron rules provided at a URL
    fromURL(URL aSCHURL)
    Create a new SchematronResourceSCH from Schematron rules provided at a URL
    final String
     
    final String
     
    com.helger.schematron.api.xslt.ISchematronXSLTBasedProvider
     
    final boolean
     
    final void
    setForceCacheResult(boolean bForceCacheResult)
    Force the caching of results.
    final void
    setLanguageCode(String sLanguageCode)
     
    final void
    setPhase(String sPhase)
     

    Methods inherited from class com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource

    applySchematronValidation, applySchematronValidationToSVRL, getErrorListener, getSchematronValidity, getURIResolver, getXSLTValidator, isValidateSVRL, isValidSchematron, parameters, setEntityResolver, setErrorListener, setURIResolver, setValidateSVRL, setXSLTValidator, toString

    Methods inherited from class com.helger.schematron.AbstractSchematronResource

    applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getAsNode, getAsNode, getEntityResolver, getID, getResource, getSchematronValidity, getSchematronValidity, internalCreateDOMReaderSettings, internalSetEntityResolver, isLenient, isUseCache, setLenient, setUseCache

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface com.helger.commons.traits.IGenericImplTrait

    thisAsT

    Methods inherited from interface com.helger.commons.id.IHasID

    getID

    Methods inherited from interface com.helger.schematron.ISchematronResource

    applySchematronValidation, applySchematronValidation, applySchematronValidationToSVRL, applySchematronValidationToSVRL, getEntityResolver, getResource, getSchematronValidity, getSchematronValidity, isLenient, isUseCache, setLenient, setUseCache

    Methods 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 be null.
  • Method Details

    • getPhase

      @Nullable public final String getPhase()
    • setPhase

      public final void setPhase(@Nullable String sPhase)
    • getLanguageCode

      @Nullable public final String getLanguageCode()
    • setLanguageCode

      public final void setLanguageCode(@Nullable String sLanguageCode)
    • isForceCacheResult

      public final boolean isForceCacheResult()
      Returns:
      true if internal caching of the result should be forced, false if 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 - true to force result caching, false to cache only if no parameters are present.
      Since:
      5.2.1
    • applyDefaultValuesOnTransformerCustomizer

      @Nonnull protected final TransformerCustomizerSCH applyDefaultValuesOnTransformerCustomizer(@Nonnull TransformerCustomizerSCH aTC)
    • createTransformerCustomizer

      @Nonnull @OverrideOnDemand protected TransformerCustomizerSCH createTransformerCustomizer()
    • getXSLTProvider

      @Nullable public com.helger.schematron.api.xslt.ISchematronXSLTBasedProvider getXSLTProvider()
      Specified by:
      getXSLTProvider in class com.helger.schematron.api.xslt.AbstractSchematronXSLTBasedResource<SchematronResourceSCH>
    • fromClassPath

      @Nonnull public static SchematronResourceSCH fromClassPath(@Nonnull @Nonempty String sSCHPath)
      Create a new Schematron resource.
      Parameters:
      sSCHPath - The classpath relative path to the Schematron file. May neither be null nor 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 be null nor empty.
      aClassLoader - The class loader to be used to retrieve the classpath resource. May be null.
      Returns:
      Never null.
      Since:
      6.0.4
    • fromFile

      @Nonnull public static SchematronResourceSCH fromFile(@Nonnull @Nonempty String sSCHPath)
      Create a new Schematron resource.
      Parameters:
      sSCHPath - The file system path to the Schematron file. May neither be null nor empty.
      Returns:
      Never null.
    • fromFile

      @Nonnull public static SchematronResourceSCH fromFile(@Nonnull File aSCHFile)
      Create a new Schematron resource.
      Parameters:
      aSCHFile - The Schematron file. May not be null.
      Returns:
      Never null.
    • fromURL

      @Nonnull public static SchematronResourceSCH fromURL(@Nonnull @Nonempty String sSCHURL) throws MalformedURLException
      Create a new SchematronResourceSCH from Schematron rules provided at a URL
      Parameters:
      sSCHURL - The URL to the Schematron rules. May neither be null nor empty.
      Returns:
      Never null.
      Throws:
      MalformedURLException - In case an invalid URL is provided
      Since:
      6.2.6
    • fromURL

      @Nonnull public static SchematronResourceSCH fromURL(@Nonnull URL aSCHURL)
      Create a new SchematronResourceSCH from Schematron rules provided at a URL
      Parameters:
      aSCHURL - The URL to the Schematron rules. May not be null.
      Returns:
      Never null.
      Since:
      6.2.6
    • fromInputStream

      @Nonnull public static SchematronResourceSCH fromInputStream(@Nonnull @Nonempty String sResourceID, @Nonnull InputStream aSchematronIS)
      Create a new SchematronResourceSCH from Schematron rules provided by an arbitrary InputStream.
      Important: in this case, no include resolution will be performed!!
      Parameters:
      sResourceID - Resource ID to be used as the cache key. Should neither be null nor empty.
      aSchematronIS - The InputStream to read the Schematron rules from. May not be null.
      Returns:
      Never null.
      Since:
      6.2.6
    • fromByteArray

      @Nonnull public static SchematronResourceSCH fromByteArray(@Nonnull byte[] aSchematron)
      Create a new SchematronResourceSCH from 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 be null.
      Returns:
      Never null.
      Since:
      6.2.6
    • fromString

      @Nonnull public static SchematronResourceSCH fromString(@Nonnull String sSchematron, @Nonnull Charset aCharset)
      Create a new SchematronResourceSCH from 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 be null .
      aCharset - The charset to be used to convert the String to a byte array.
      Returns:
      Never null.
      Since:
      6.2.6