Package net.sf.saxon.expr
Class PackageData
java.lang.Object
net.sf.saxon.expr.PackageData
- Direct Known Subclasses:
StylesheetPackage
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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGlobalVariable
(GlobalVariable variable) Add a global variable to the list of global variables contained in this packageGet the object that manages accumulator functionsGet the Configuration to which this package belongsGet a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.Get the SlotManager used to record the names and slot numbers of all global variablesGet the list of global variables contained in this packageGet the language in which this package is writtenint
Get the version of the host languageGet the KeyManager, containing definitions of keys available for use.int
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 licenseGet the target Saxon edition under which this package will executeboolean
Ask whether the package can be deployed to a different location, with a different base URIboolean
Ask whether the package is schema-awareboolean
isXSLT()
Ask if the host language is XSLTGet the type alias manager if one already exists, creating it if it does not already existvoid
setAccumulatorRegistry
(AccumulatorRegistry accumulatorRegistry) Set the object that manages accumulator functionsvoid
setConfiguration
(Configuration configuration) Set the Configuration to which this package belongsvoid
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 variablesvoid
setHostLanguage
(HostLanguage hostLanguage, int version) Set the language and version in which this package is writtenvoid
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 licensevoid
setRelocatable
(boolean relocatable) Say whether the package can be deployed to a different location, with a different base URIvoid
setSchemaAware
(boolean schemaAware) Say whether the package is schema-awarevoid
setTargetEdition
(String edition) Set the target Saxon edition under which this package will executevoid
setTypeAliasManager
(TypeAliasManager manager)
-
Field Details
-
config
-
hostLanguageVersion
protected int hostLanguageVersion -
keyManager
-
-
Constructor Details
-
PackageData
Create a PackageData object- Parameters:
config
- the Saxon configuration
-
-
Method Details
-
getConfiguration
Get the Configuration to which this package belongs- Returns:
- the Saxon configuration
-
setConfiguration
Set the Configuration to which this package belongs- Parameters:
configuration
- the Saxon configuration
-
getHostLanguage
Get the language in which this package is written- Returns:
- typically
HostLanguage.XSLT
,HostLanguage.XQUERY
, orHostLanguage.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
Set the language and version in which this package is written- Parameters:
hostLanguage
- typicallyHostLanguage.XSLT
,HostLanguage.XQUERY
, orHostLanguage.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
Set the target Saxon edition under which this package will execute- Parameters:
edition
- the Saxon edition e.g. "HE" or "JS"
-
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
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
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
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
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
Get the object that manages accumulator functions- Returns:
- the class that manages accumulators.
-
setAccumulatorRegistry
Set the object that manages accumulator functions- Parameters:
accumulatorRegistry
- the manager of accumulator functions
-
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
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
Add a global variable to the list of global variables contained in this package- Parameters:
variable
- the global variable to be added
-
getGlobalVariableList
Get the list of global variables contained in this package- Returns:
- the list of global variables
-
setTypeAliasManager
-
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
-