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.ObjectInformation 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 Configurationconfigprotected KeyManagerkeyManager
-
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 voidaddGlobalVariable(GlobalVariable variable)Add a global variable to the list of global variables contained in this packageAccumulatorRegistrygetAccumulatorRegistry()Get the object that manages accumulator functionsConfigurationgetConfiguration()Get the Configuration to which this package belongsDecimalFormatManagergetDecimalFormatManager()Get a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.SlotManagergetGlobalSlotManager()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 packageHostLanguagegetHostLanguage()Get the language in which this package is writtenKeyManagergetKeyManager()Get the KeyManager, containing definitions of keys available for use.intgetLocalLicenseId()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.StringgetTargetEdition()Get the target Saxon edition under which this package will executebooleanisRelocatable()Ask whether the package can be deployed to a different location, with a different base URIbooleanisSchemaAware()Ask whether the package is schema-awarebooleanisXSLT()Ask if the host language is XSLTTypeAliasManagerobtainTypeAliasManager()Get the type alias manager if one already exists, creating it if it does not already existvoidsetAccumulatorRegistry(AccumulatorRegistry accumulatorRegistry)Set the object that manages accumulator functionsvoidsetConfiguration(Configuration configuration)Set the Configuration to which this package belongsvoidsetDecimalFormatManager(DecimalFormatManager manager)Set a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.voidsetGlobalSlotManager(SlotManager manager)Set the SlotManager to be used to record the names and slot numbers of all global variablesvoidsetHostLanguage(HostLanguage hostLanguage)Set the language in which this package is writtenvoidsetKeyManager(KeyManager manager)Set the KeyManager, containing definitions of keys available for use.voidsetLocalLicenseId(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 licensevoidsetRelocatable(boolean relocatable)Say whether the package can be deployed to a different location, with a different base URIvoidsetSchemaAware(boolean schemaAware)Say whether the package is schema-awarevoidsetTargetEdition(java.lang.String edition)Set the target Saxon edition under which this package will executevoidsetTypeAliasManager(TypeAliasManager manager)
-
-
-
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, orHostLanguage.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- typicallyHostLanguage.XSLT,HostLanguage.XQUERY, orHostLanguage.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
-
-