Class PackageData

java.lang.Object
net.sf.saxon.expr.PackageData
Direct Known Subclasses:
StylesheetPackage

public class PackageData extends Object
Information about a unit of compilation: in XSLT, a package; in XQuery, a module. May also be a single free-standing XPath expression.
  • Field Details

    • config

      protected Configuration config
    • hostLanguageVersion

      protected int hostLanguageVersion
    • keyManager

      protected KeyManager keyManager
  • Constructor Details

    • PackageData

      public PackageData(Configuration config)
      Create a PackageData object
      Parameters:
      config - the Saxon configuration
  • Method Details

    • getConfiguration

      public Configuration getConfiguration()
      Get the Configuration to which this package belongs
      Returns:
      the Saxon configuration
    • setConfiguration

      public void setConfiguration(Configuration configuration)
      Set the Configuration to which this package belongs
      Parameters:
      configuration - the Saxon configuration
    • getHostLanguage

      public HostLanguage getHostLanguage()
      Get the language in which this package is written
      Returns:
      typically HostLanguage.XSLT, HostLanguage.XQUERY, or HostLanguage.XPATH
    • getHostLanguageVersion

      public int getHostLanguageVersion()
      Get the version of the host language
      Returns:
      the host language version, as an integer: for example 31 represents 3.1.
    • isXSLT

      public boolean isXSLT()
      Ask if the host language is XSLT
      Returns:
      true if the host language is XSLT
    • setHostLanguage

      public void setHostLanguage(HostLanguage hostLanguage, int version)
      Set the language and version in which this package is written
      Parameters:
      hostLanguage - typically HostLanguage.XSLT, HostLanguage.XQUERY, or HostLanguage.XPATH
      version - the host language version, as an integer (for example 30 represents 3.0, 31 represents 3.1)
    • setLocalLicenseId

      public void setLocalLicenseId(int id)
      Set the local license id, identifying any local license in the case where this package was loaded from a compiled package that contained its own embedded license
      Parameters:
      id - identifier used to distinguish this local license
    • getLocalLicenseId

      public int getLocalLicenseId()
      Get the local license id, identifying any local license in the case where this package was loaded from a compiled package that contained its own embedded license
      Returns:
      integer identifying the local license, or -1 if there is none
    • setTargetEdition

      public void setTargetEdition(String edition)
      Set the target Saxon edition under which this package will execute
      Parameters:
      edition - the Saxon edition e.g. "HE" or "JS"
    • getTargetEdition

      public String getTargetEdition()
      Get the target Saxon edition under which this package will execute
      Returns:
      the Saxon edition e.g. "HE" or "JS"
    • isRelocatable

      public boolean isRelocatable()
      Ask whether the package can be deployed to a different location, with a different base URI
      Returns:
      if true then static-base-uri() represents the deployed location of the package, rather than its compile time location
    • setRelocatable

      public void setRelocatable(boolean relocatable)
      Say whether the package can be deployed to a different location, with a different base URI
      Parameters:
      relocatable - if true then static-base-uri() represents the deployed location of the package, rather than its compile time location
    • isSchemaAware

      public boolean isSchemaAware()
      Ask whether the package is schema-aware
      Returns:
      true if the package is schema-aware
    • setSchemaAware

      public void setSchemaAware(boolean schemaAware)
      Say whether the package is schema-aware
      Parameters:
      schemaAware - set to true if the package is schema-aware
    • getDecimalFormatManager

      public DecimalFormatManager getDecimalFormatManager()
      Get a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.
      Returns:
      the decimal format manager for this static context; a newly created empty DecimalFormatManager if none has been supplied
      Since:
      9.2
    • setDecimalFormatManager

      public void setDecimalFormatManager(DecimalFormatManager manager)
      Set a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.
      Parameters:
      manager - the decimal format manager for this static context
    • getKeyManager

      public KeyManager getKeyManager()
      Get the KeyManager, containing definitions of keys available for use.
      Returns:
      the KeyManager. This is used to resolve key names, both explicit calls on key() used in XSLT, and system-generated calls on key() which may also appear in XQuery and XPath
    • setKeyManager

      public void setKeyManager(KeyManager manager)
      Set the KeyManager, containing definitions of keys available for use.
      Parameters:
      manager - the KeyManager. This is used to resolve key names, both explicit calls on key() used in XSLT, and system-generated calls on key() which may also appear in XQuery and XPath
    • getAccumulatorRegistry

      public AccumulatorRegistry getAccumulatorRegistry()
      Get the object that manages accumulator functions
      Returns:
      the class that manages accumulators.
    • setAccumulatorRegistry

      public void setAccumulatorRegistry(AccumulatorRegistry accumulatorRegistry)
      Set the object that manages accumulator functions
      Parameters:
      accumulatorRegistry - the manager of accumulator functions
    • getGlobalSlotManager

      public SlotManager getGlobalSlotManager()
      Get the SlotManager used to record the names and slot numbers of all global variables
      Returns:
      the SlotManager used for global variables contained in this package
    • setGlobalSlotManager

      public void setGlobalSlotManager(SlotManager manager)
      Set the SlotManager to be used to record the names and slot numbers of all global variables
      Parameters:
      manager - the SlotManager used for global variables contained in this package
    • addGlobalVariable

      public void addGlobalVariable(GlobalVariable variable)
      Add a global variable to the list of global variables contained in this package
      Parameters:
      variable - the global variable to be added
    • getGlobalVariableList

      public List<GlobalVariable> getGlobalVariableList()
      Get the list of global variables contained in this package
      Returns:
      the list of global variables
    • setTypeAliasManager

      public void setTypeAliasManager(TypeAliasManager manager)
    • obtainTypeAliasManager

      public TypeAliasManager obtainTypeAliasManager()
      Get the type alias manager if one already exists, creating it if it does not already exist
      Returns:
      a type alias manager, newly created if necessary