Package net.sf.saxon.expr

## Class PackageData

- java.lang.Object
- - net.sf.saxon.expr.PackageData

- Direct Known Subclasses:
    `StylesheetPackage`

      public class PackageData
      extends java.lang.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 Summary

    Fields
    Modifier and Type | Field | Description
    --- | --- | ---
    `protected Configuration` | `config` |
    `protected KeyManager` | `keyManager` |

  - ### Constructor Summary

    Constructors
    Constructor | Description
    --- | ---
    `PackageData​(Configuration config)` | Create a PackageData object
    `PackageData​(PackageData p)` | Create a PackageData object as a copy of an existing PackageData

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `void` | `addGlobalVariable​(GlobalVariable variable)` | Add a global variable to the list of global variables contained in this package
    `AccumulatorRegistry` | `getAccumulatorRegistry()` | Get the object that manages accumulator functions
    `Configuration` | `getConfiguration()` | Get the Configuration to which this package belongs
    `DecimalFormatManager` | `getDecimalFormatManager()` | Get a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.
    `SlotManager` | `getGlobalSlotManager()` | Get the SlotManager used to record the names and slot numbers of all global variables
    `java.util.List<GlobalVariable>` | `getGlobalVariableList()` | Get the list of global variables contained in this package
    `HostLanguage` | `getHostLanguage()` | Get the language in which this package is written
    `KeyManager` | `getKeyManager()` | Get the KeyManager, containing definitions of keys available for use.
    `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
    `java.lang.String` | `getTargetEdition()` | Get the target Saxon edition under which this package will execute
    `boolean` | `isRelocatable()` | Ask whether the package can be deployed to a different location, with a different base URI
    `boolean` | `isSchemaAware()` | Ask whether the package is schema-aware
    `boolean` | `isXSLT()` | Ask if the host language is XSLT
    `TypeAliasManager` | `obtainTypeAliasManager()` | Get the type alias manager if one already exists, creating it if it does not already exist
    `void` | `setAccumulatorRegistry​(AccumulatorRegistry accumulatorRegistry)` | Set the object that manages accumulator functions
    `void` | `setConfiguration​(Configuration configuration)` | Set the Configuration to which this package belongs
    `void` | `setDecimalFormatManager​(DecimalFormatManager manager)` | Set a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.
    `void` | `setGlobalSlotManager​(SlotManager manager)` | Set the SlotManager to be used to record the names and slot numbers of all global variables
    `void` | `setHostLanguage​(HostLanguage hostLanguage)` | Set the language in which this package is written
    `void` | `setKeyManager​(KeyManager manager)` | Set the KeyManager, containing definitions of keys available for use.
    `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
    `void` | `setRelocatable​(boolean relocatable)` | Say whether the package can be deployed to a different location, with a different base URI
    `void` | `setSchemaAware​(boolean schemaAware)` | Say whether the package is schema-aware
    `void` | `setTargetEdition​(java.lang.String edition)` | Set the target Saxon edition under which this package will execute
    `void` | `setTypeAliasManager​(TypeAliasManager manager)` |

    - ### Methods inherited from class java.lang.Object

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

- - ### Field Detail

    - #### config

          protected Configuration config

    - #### keyManager

          protected KeyManager keyManager

  - ### Constructor Detail

    - #### PackageData

          public PackageData​(Configuration config)

      Create a PackageData object
      Parameters:
        `config` - the Saxon configuration

    - #### PackageData

          public PackageData​(PackageData p)

      Create a PackageData object as a copy of an existing PackageData
      Parameters:
        `p` - the existing PackageData object

  - ### Method Detail

    - #### 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`

    - #### 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)

      Set the language in which this package is written
      Parameters:
        `hostLanguage` - typically `HostLanguage.XSLT`, `HostLanguage.XQUERY`, or `HostLanguage.XPATH`

    - #### 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​(java.lang.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 java.lang.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 java.util.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