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 int
hostLanguageVersion
protected KeyManager
keyManager
-
Constructor Summary
Constructors Constructor Description PackageData(Configuration config)
Create a PackageData objectPackageData(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 packageAccumulatorRegistry
getAccumulatorRegistry()
Get the object that manages accumulator functionsConfiguration
getConfiguration()
Get the Configuration to which this package belongsDecimalFormatManager
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 variablesjava.util.List<GlobalVariable>
getGlobalVariableList()
Get the list of global variables contained in this packageHostLanguage
getHostLanguage()
Get the language in which this package is writtenint
getHostLanguageVersion()
Get the version of the host languageKeyManager
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 licensejava.lang.String
getTargetEdition()
Get the target Saxon edition under which this package will executeboolean
isRelocatable()
Ask whether the package can be deployed to a different location, with a different base URIboolean
isSchemaAware()
Ask whether the package is schema-awareboolean
isXSLT()
Ask if the host language is XSLTTypeAliasManager
obtainTypeAliasManager()
Get 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
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 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(java.lang.String edition)
Set the target Saxon edition under which this package will executevoid
setTypeAliasManager(TypeAliasManager manager)
-
-
-
Field Detail
-
config
protected Configuration config
-
hostLanguageVersion
protected int hostLanguageVersion
-
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
, 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
public void setHostLanguage(HostLanguage hostLanguage, int version)
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
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
-
-