Package com.saxonica.config
Class EnterpriseConfiguration
- java.lang.Object
-
- net.sf.saxon.Configuration
-
- com.saxonica.config.ProfessionalConfiguration
-
- com.saxonica.config.EnterpriseConfiguration
-
- All Implemented Interfaces:
SourceResolver
,NotationSet
public final class EnterpriseConfiguration extends ProfessionalConfiguration
A subclass of Configuration that defines a processor with Saxon-EE capabilities. This contains helper methods invoked both at compile time and at run-time to perform operations that are allowed only in a schema-aware processor; the superclass Configuration contains the dummy versions of these methods used in a non-schema-aware processor. The interface is designed so that the calling classes contain no references to classes that are available only in the schema-aware product.Applications should avoid using this class directly, and should instead access all the necessary functionality through its superclass,
Configuration
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class net.sf.saxon.Configuration
Configuration.ApiProvider, Configuration.LicenseFeature
-
-
Field Summary
-
Fields inherited from class com.saxonica.config.ProfessionalConfiguration
vendorFunctionSet
-
Fields inherited from class net.sf.saxon.Configuration
booleanFeatures, builtInExtensionLibraryList, byteCodeThreshold, defaultStaticQueryContext, defaultXsltCompilerInfo, optimizer, optimizerOptions, staticContextForSystemFunctions, typeHierarchy, XML10, XML11, XSD10, XSD11, xsdVersion
-
-
Constructor Summary
Constructors Constructor Description EnterpriseConfiguration()
Create an EnterpriseConfiguration
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addSchema(PreparedSchema pschema)
Add a schema (a collection of schema components) to the cachevoid
addSchemaForBuiltInNamespace(java.lang.String namespace)
Add a built-in schema for a given namespace.void
addSchemaSource(javax.xml.transform.Source schemaSource, ErrorReporter errorReporter)
Load a schema, which will be available for use by all subsequent operations using this EnterpriseConfiguration.void
addSchemaSource(javax.xml.transform.Source schemaSource, ErrorReporter errorReporter, SchemaCompiler compiler)
Load a schema, which will be available for use by all subsequent operations using this EnterpriseConfiguration.void
addSurrogateSchema(java.lang.String namespace)
Put a temporary schema marker in the cache, to indicate that a schema for a given namespace is being processed.void
checkLicensedFeature(int feature, java.lang.String name, int localLicenseId)
Check whether a particular feature is licensed, with a fatal error if it is notvoid
checkStrictStreamability(XSLTemplate template, Expression body)
Check the streamability of a template rulevoid
checkTypeDerivationIsOK(SchemaType derived, SchemaType base, int block)
Check that a type is validly derived from another type, following the rules for the Schema Component Constraint "Is Type Derivation OK (Simple)" (3.14.6) or "Is Type Derivation OK (Complex)" (3.4.6) as appropriate.void
clearSchemaCache()
Remove all schema components that have been loaded into this Configuration.RegularExpression
compileRegularExpression(java.lang.CharSequence regex, java.lang.String flags, java.lang.String hostLanguage, java.util.List<java.lang.String> warnings)
Compile a regular expression (or, in some configurations, get a compiled regular expression from a cachevoid
createByteCodeReport(java.lang.String fileName)
Generate a report on byte code instrumentation to a specified fileInvalidityReportGeneratorEE
createValidityReporter()
Register a report generator for reporting invalidities detected in the course of schema validationvoid
declareBuiltInExtensionElementNamespaces()
Declare the built-in XSLT extension element namespacesvoid
exportComponents(Receiver out)
Export a precompiled Schema Component Model containing all the components (except built-in components) that have been loaded into this Processor.Receiver
getAnnotationStripper(Receiver destination)
Add to a pipeline a receiver that strips all type annotations.SchemaDeclaration
getAttributeDeclaration(int fingerprint)
Get a global attribute declaration by fingerprintSchemaDeclaration
getAttributeDeclaration(StructuredQName attributeName)
Get a global attribute declaration by name<T> T
getConfigurationProperty(Feature<T> feature)
Get a property of the configurationjava.util.Collection<GlobalParam>
getDeclaredSchemaParameters()
Get the set of saxon:param schema parameters declared in the schema held by this Configuration.ContextItemStaticInfo
getDefaultContextItemStaticInfo()
Get a default ContextItemStaticInfo, indication no information is available about the context item typeReceiver
getDocumentValidator(Receiver receiver, java.lang.String systemId, ParseOptions validationOptions, Location initiatingLocation)
Get a document-level validator to add to a Receiver pipelinejava.lang.String
getEditionCode()
Get the edition code identifying this configuration: "HE", "PE" or "EE"SchemaDeclaration
getElementDeclaration(int fingerprint)
Get a global element declaration by fingerprintSchemaDeclaration
getElementDeclaration(StructuredQName qName)
Get a global element declaration by name.Receiver
getElementValidator(Receiver receiver, ParseOptions options, Location location)
Get a Receiver that can be used to validate an element, and that passes the validated element on to a target receiver.java.util.Iterator<? extends SchemaType>
getExtensionsOfType(SchemaType type)
Get the set of complex types that have been defined as extensions of a given type.java.util.function.Function<SequenceIterator,FocusTrackingIterator>
getFocusTrackerFactory(Executable exec, boolean multithreaded)
Get a factory function that can be used to wrap a SequenceIterator in a FocusTrackingIterator.java.util.Set<java.lang.String>
getImportedNamespaces()
Get the set of namespaces of imported schemasSequenceIterator
getMultithreadedItemMappingIterator(SequenceIterator base, ItemMappingFunction action)
Get an item mapping iterator suitable for multi-threaded execution, if this is permittedMultithreadingFactory
getMultithreadingFactory()
Get the factory class used to handle creation of objects that support multithreaded execution.int
getNamespaceStatus(java.lang.String namespace)
Get the status of a particular schema namespace.int[]
getOccurrenceLimits()
Get the occurrence limits previously set using setOccurrenceLimits (or the default)OptimizerOptions
getOptimizerOptions()
Get the optimization options in useint
getResultDocumentThreadsLimit()
Get the number of threads to be used for xsl:result-document instructionsFunction
getSchemaAsFunctionItem()
Get information about the schema in the form of a function item.Function
getSchemaComponentAsFunctionItem(java.lang.String kind, QNameValue name)
Get information about the schema in the form of a function item.SchemaType
getSchemaType(StructuredQName name)
Get the top-level schema type definition with a given QName.SchemaURIResolver
getSchemaURIResolver()
Get the user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations; if none has been explicitly set, returns the standard schema URI resolver.PreparedSchema
getSuperSchema()
Get the SuperSchema, containing references to all names defined in all known schemasTypeHierarchy
getTypeHierarchy()
Get the TypeHierarchy: a cache holding type informationvoid
importComponents(javax.xml.transform.Source source)
Import a precompiled Schema Component Model from a given Source.boolean
isDeclaredNotation(java.lang.String uri, java.lang.String local)
Ask whether a given notation has been declared in the schemaboolean
isDeferredByteCode(HostLanguage hostLanguage)
Ask whether bytecode should be generated in Just-In-time compilation and therefore deferring the byte code generation.boolean
isGenerateByteCode(HostLanguage hostLanguage)
Ask whether bytecode should be generated.boolean
isJITEnabled()
Ask whether just-in-time compilation of XSLT template rules is in forceboolean
isSchemaAvailable(java.lang.String targetNamespace)
Determine whether the Configuration contains a cached schema for a given target namespaceboolean
isSealedNamespace(java.lang.String namespace)
Test whether a schema namespace is sealed.boolean
isStreamabilityEnabled()
Ask whether streamability checking is enabled for this configurationboolean
isStreamedNode(NodeInfo node)
Ask whether a given node is a streamed nodeAccumulatorRegistry
makeAccumulatorRegistry()
Factory method to make the AccumulatorManager, used for static information about the accumulators used in a particular packageSequence
makeClosure(Expression expression, int ref, XPathContext context)
Make a Closure, given the expected reference countCompilerInfo
makeCompilerInfo()
Make an XSLT CompilerInfo object - can be overridden in a subclass to produce variants capable of optimizationCompilerService
makeCompilerService(HostLanguage hostLanguage)
Make a CompilerService object, to handle byte code generation, or null if byte code generation is not availableContextItemStaticInfo
makeContextItemStaticInfo(ItemType itemType, boolean maybeUndefined)
Factory method to make a ContextItemStaticInfoFilterFactory
makeDocumentProjector(PathMap.PathMapRoot map)
Create a document projector for a given path map root.FilterFactory
makeDocumentProjector(XQueryExpression exp)
Create a document projector for the document supplied as the initial context item in a query.SimpleMode
makeMode(StructuredQName modeName, CompilerInfo compilerInfo)
Make a new Mode - this can be overridden in subclasses to produce optimized variantsPackageLoaderEE
makePackageLoader()
Create a package loader, for reloading SEF files, appropriate to the Saxon edition being usedPipelineConfiguration
makePipelineConfiguration()
Make a PipelineConfiguration from the properties of this ConfigurationSchemaURIResolver
makeSchemaURIResolver(javax.xml.transform.URIResolver resolver)
Make a SchemaURIResolver that wraps a supplied URIResolverGroundedValue
makeSequenceExtent(Expression expression, int ref, XPathContext context)
Make a SequenceExtent, given the expected reference countSlotManager
makeSlotManager()
Factory method to create a SlotManager.protected StaticQueryContext
makeStaticQueryContext(boolean copyFromDefault)
Make a new static query context object using the factory registered with this configurationReceiver
makeStreamingTransformer(Mode mode, ParameterSet ordinaryParams, ParameterSet tunnelParams, Outputter out, XPathContext context)
Create a streaming transformerExpression
makeStreamInstruction(Expression hrefExp, Expression body, boolean streaming, ParseOptions options, PackageData packageData, Location location, RetainedStaticContext rsc)
StyleNodeFactory
makeStyleNodeFactory(Compilation compilation)
Factory method to make a StyleNodeFactory, used for constructing elements in a stylesheet documentStylesheetPackage
makeStylesheetPackage()
Factory method to make a StylesheetPackageTemplateRuleEE
makeTemplateRule()
Factory method to create a Template RuleXPathContextMajor.ThreadManager
makeThreadManager()
Make a ThreadManager for asynchronous xsl:result-document instructionsUserUnionType
makeUserUnionType(java.util.List<AtomicType> memberTypes)
Make a union type with a given list of member typesprotected BuiltInFunctionSet
makeVendorFunctionSet()
Create a function library for Saxon-defined extension functions available in Enterprise EditionXQueryExpression
makeXQueryExpression(Expression exp, QueryModule mainModule, boolean streaming)
Factory method to make an XQueryExpressionprotected void
needEnterpriseEdition()
Throw an error indicating that a request cannot be satisfied because it requires the enterprise edition of Saxon.ExpressionPresenter
newExpressionExporter(java.lang.String target, java.io.OutputStream destination, StylesheetPackage rootPackage)
Get a new ExpressionPresenter capable of exporting a compiled stylesheetXPathParser
newExpressionParser(java.lang.String language, boolean updating, int languageVersion)
Make an expression Parser for a specified version of XPath or XQueryPendingUpdateList
newPendingUpdateList()
Get a new Pending Update ListSchemaCompiler
newSchemaCompiler()
Make a SchemaCompiler which can be used to compile schema documents.UserFunction
newUserFunction(boolean memoFunction, FunctionStreamability streamability)
Make a UserFunction object.ByteCodeMonitor
obtainByteCodeMonitor()
Obtain a ByteCodeMonitor for monitoring hotspot bytecode generationOptimizer
obtainOptimizer()
Factory method to get an OptimizerOptimizer
obtainOptimizer(OptimizerOptions options)
Factory method to get an Optimizer with specified optimizer options.void
prepareValidationReporting(XPathContext context, ParseOptions options)
Set validation reporting options.void
processResultDocument(ResultDocument instruction, Expression content, XPathContext context)
Process an xsl:result-document instruction.protected Configuration
readConfigurationFile(javax.xml.transform.Source source)
Read the configuration file an construct a new Configuration (the real one)java.lang.String
readInlineSchema(NodeInfo root, java.lang.String expected, ErrorReporter errorReporter)
Read an inline schema from a stylesheetvoid
readMultipleSchemas(PipelineConfiguration pipe, java.lang.String baseURI, java.util.Collection<java.lang.String> schemaLocations, java.lang.String expected)
Read schema documents from a list of schema locationsjava.lang.String
readSchema(PipelineConfiguration pipe, java.lang.String baseURI, java.lang.String schemaLocation, java.lang.String expected)
Read a schema from a given schema locationvoid
removeSchema(java.lang.String namespace)
Remove the schema for a given namespace.void
sealNamespace(java.lang.String namespace)
Mark a schema namespace as being sealed.<T> void
setConfigurationProperty(Feature<T> feature, T value)
Set a property of the configuration.protected void
setLicensedFeatures()
void
setMultithreadingFactory(MultithreadingFactory factory)
Set a factory class to handle creation of objects that support multithreaded execution.void
setNamespaceStatus(java.lang.String namespace, int status)
Set the status of a particular schema namespace.void
setOccurrenceLimits(int minimum, int maximum)
Set the occurrence limits to be used when compiling a finite state automaton.void
setSchemaURIResolver(SchemaURIResolver resolver)
Set a user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations.void
setStreamabilityEnabled(boolean enabled)
Set the streamability rules to be applied.protected boolean
testFeature(int feature)
Determine if a particular feature is licensed.SimpleType
validateAttribute(StructuredQName nodeName, java.lang.CharSequence value, int validation)
Validate an attribute value (XSLT only)-
Methods inherited from class com.saxonica.config.ProfessionalConfiguration
addExtensionBinders, bindExtensions, bindSaxonExtensionFunction, declareBuiltInExtensionFunctions, disableLicensing, displayLicenseMessage, externalObjectAsMap, forceLoadLicense, getBuiltInExtensionLibraryList, getExtensionBinder, getExtensionElementFactory, getFeature, getJavaExternalObjectType, getLicenseFeature, getSystemFunction, getVendorFunctionSet, getXQueryUpdateFunctionSet, importLicenseDetails, isExtensionElementAvailable, isFeatureAllowedBySecondaryLicense, isLicensedFeature, isLicenseFound, isLicenseNotFound, loadLicense, makeConfigurationReader, makeMethodMap, makeObjectLookupExpression, makeProfessionalConfiguration, makeTypeAliasManager, registerLocalLicense, reportIfMissingLicenseFeature, resolveSource, setConfigurationProperty, setExtensionBinder, setExtensionElementNamespace, supplyLicenseKey
-
Methods inherited from class net.sf.saxon.Configuration
addSchemaSource, buildDocumentTree, buildDocumentTree, close, createXMLParser, getAllowedUriTest, getBooleanProperty, getCharacterSetFactory, getClass, getCollation, getCollation, getCollation, getCollationURIResolver, getCollectionFinder, getConfiguration, getConfigurationProperty, getConversionContext, getConversionRules, getCountDown, getDebugger, getDefaultCollationName, getDefaultCollection, getDefaultCountry, getDefaultLanguage, getDefaultRegexEngine, getDefaultSerializationProperties, getDefaultStaticQueryContext, getDefaultXsltCompilerInfo, getDocumentNumberAllocator, getDynamicLoader, getExternalObjectModel, getExternalObjectModel, getExternalObjectModels, getFunctionAnnotationHandler, getGlobalDocumentPool, getInstance, getIntegratedFunctionLibrary, getLabel, getLocalizerFactory, getLogger, getMediaQueryEvaluator, getMediaTypeForFileExtension, getMessageEmitterClass, getModuleURIResolver, getNamePool, getOutputURIResolver, getParseOptions, getProcessor, getProductTitle, getResourceFactoryForMediaType, getSchemaValidationMode, getSerializerFactory, getSourceParser, getSourceParserClass, getSourceResolver, getStandardCollectionFinder, getStandardErrorOutput, getStandardModuleURIResolver, getStyleParser, getStyleParserClass, getSystemURIResolver, getTraceListener, getTraceListenerClass, getTraceListenerOutputFile, getTreeModel, getTreeStatistics, getTypeChecker, getUnparsedTextURIResolver, getURIResolver, getUseWhenFunctionSet, getValidCharacterChecker, getXMLVersion, getXPath30FunctionSet, getXPath31FunctionSet, getXsdVersion, getXSLT30FunctionSet, init, instantiateClassName, instantiateConfiguration, internalSetBooleanProperty, isAssertionsEnabled, isCompatible, isCompileWithTracing, isExpandAttributeDefaults, isLineNumbering, isStripsAllWhiteSpace, isTiming, isValidation, isValidationWarnings, isVersionWarning, isXIncludeAware, loadSchema, locateResource, locateResourceSource, makeEmitter, makeErrorReporter, makeEvaluateInstruction, makeLicensedConfiguration, makeNumberer, makeParser, makeSystemFunction, makeTraceListener, makeTraceListener, makeURIResolver, newConfiguration, newStaticQueryContext, obtainDefaultSerializationProperties, readConfiguration, readConfiguration, readConfigurationFile, registerCollation, registerCollection, registerExtensionFunction, registerExternalObjectModel, registerFileExtension, registerFunctionAnnotationHandler, registerMediaType, reportFatalError, requireBoolean, requireInteger, requireProfessionalLicense, requireString, reuseSourceParser, reuseStyleParser, setAllowedUriTest, setBooleanProperty, setBooleanProperty, setCollationURIResolver, setCollectionFinder, setCompileWithTracing, setConversionRules, setDebugger, setDefaultCollection, setDefaultCountry, setDefaultLanguage, setDefaultRegexEngine, setDefaultSerializationProperties, setDocumentNumberAllocator, setDynamicLoader, setErrorReporterFactory, setExpandAttributeDefaults, setLabel, setLineNumbering, setLocalizerFactory, setLogger, setMediaQueryEvaluator, setMessageEmitterClass, setModuleURIResolver, setModuleURIResolver, setNamePool, setOutputURIResolver, setParameterizedURIResolver, setProcessor, setSchemaValidationMode, setSerializerFactory, setSourceParserClass, setSourceResolver, setStandardErrorOutput, setStaticQueryContextFactory, setStyleParserClass, setTiming, setTraceListener, setTraceListenerClass, setTraceListenerOutputFile, setTreeModel, setUnparsedTextURIResolver, setURIResolver, setValidation, setValidationWarnings, setVersionWarning, setXIncludeAware, setXMLVersion, unravel
-
-
-
-
Method Detail
-
makeStaticQueryContext
protected StaticQueryContext makeStaticQueryContext(boolean copyFromDefault)
Description copied from class:Configuration
Make a new static query context object using the factory registered with this configuration- Overrides:
makeStaticQueryContext
in classConfiguration
- Parameters:
copyFromDefault
- true if the new static query context is to copy the properties of the default static query context held in the configuration- Returns:
- the new static query context object
-
getEditionCode
public java.lang.String getEditionCode()
Get the edition code identifying this configuration: "HE", "PE" or "EE"- Overrides:
getEditionCode
in classProfessionalConfiguration
- Returns:
- the code identifying the Saxon edition associated with this configuration
-
setConfigurationProperty
public <T> void setConfigurationProperty(Feature<T> feature, T value)
Set a property of the configuration. This method underpins the setAttribute() method of the TransformerFactory implementation, and is provided to enable setting of Configuration properties using URIs without instantiating a TransformerFactory: specifically, this may be useful when running XQuery, and it is also used by the Validator API- Overrides:
setConfigurationProperty
in classProfessionalConfiguration
- Type Parameters:
T
- the type of value required for this particular feature- Parameters:
feature
- the property to be set. See the classFeature
for constants representing the properties that can be set.value
- the value of the property- Throws:
java.lang.IllegalArgumentException
- if the property name is not recognized or if the value is not a valid value for the named property
-
readConfigurationFile
protected Configuration readConfigurationFile(javax.xml.transform.Source source) throws XPathException
Read the configuration file an construct a new Configuration (the real one)- Overrides:
readConfigurationFile
in classProfessionalConfiguration
- Parameters:
source
- the source of the configuration file- Returns:
- the Configuration that will be used for real work
- Throws:
XPathException
- if, for example, the configuration file is invalid
-
getConfigurationProperty
public <T> T getConfigurationProperty(Feature<T> feature)
Get a property of the configuration- Overrides:
getConfigurationProperty
in classConfiguration
- Type Parameters:
T
- the type of value returned for this particular feature- Parameters:
feature
- the required property. See the classFeature
for constants representing the property names that can be requested.- Returns:
- the value of the property
- Throws:
java.lang.IllegalArgumentException
- thrown if the property is not one that Saxon recognizes.
-
checkLicensedFeature
public void checkLicensedFeature(int feature, java.lang.String name, int localLicenseId) throws LicenseException
Check whether a particular feature is licensed, with a fatal error if it is not- Overrides:
checkLicensedFeature
in classProfessionalConfiguration
- Parameters:
feature
- the feature in question, identified by a constant in classConfiguration.LicenseFeature
name
- the name of the required feature, for use in diagnosticslocalLicenseId
- identifies a license key embedded in the SEF file- Throws:
LicenseException
- if the feature is not licensed
-
setLicensedFeatures
protected void setLicensedFeatures()
- Overrides:
setLicensedFeatures
in classProfessionalConfiguration
-
testFeature
protected boolean testFeature(int feature)
Determine if a particular feature is licensed. Note, this method should only be called if it is known that the license file has been loaded. If it is not known whether the license file has been loaded, use the methodConfiguration.isLicensedFeature(int)
which will load the license when necessary.- Overrides:
testFeature
in classProfessionalConfiguration
- Parameters:
feature
- the feature in question, identified by a constant in classConfiguration.LicenseFeature
- Returns:
- true if the feature is available, otherwise false
-
needEnterpriseEdition
protected void needEnterpriseEdition()
Throw an error indicating that a request cannot be satisfied because it requires the enterprise edition of Saxon. If we get this far, we've got Saxon-EE loaded, and an EnterpriseConfiguration; the problem must therefore be with the license file.- Overrides:
needEnterpriseEdition
in classConfiguration
-
makeStyleNodeFactory
public StyleNodeFactory makeStyleNodeFactory(Compilation compilation)
Factory method to make a StyleNodeFactory, used for constructing elements in a stylesheet document- Overrides:
makeStyleNodeFactory
in classProfessionalConfiguration
- Parameters:
compilation
- the compilation episode (compiling one XSLT package)- Returns:
- the StyleNodeFactory used in this Configuration
-
makeStylesheetPackage
public StylesheetPackage makeStylesheetPackage()
Factory method to make a StylesheetPackage- Overrides:
makeStylesheetPackage
in classConfiguration
- Returns:
- a StylesheetPackage suitable for use in this Configuration
-
makeAccumulatorRegistry
public AccumulatorRegistry makeAccumulatorRegistry()
Factory method to make the AccumulatorManager, used for static information about the accumulators used in a particular package- Overrides:
makeAccumulatorRegistry
in classConfiguration
- Returns:
- a new AccumulatorManager appropriate to this Configuration
-
makeVendorFunctionSet
protected BuiltInFunctionSet makeVendorFunctionSet()
Create a function library for Saxon-defined extension functions available in Enterprise Edition- Overrides:
makeVendorFunctionSet
in classProfessionalConfiguration
- Returns:
- the new function library
-
newUserFunction
public UserFunction newUserFunction(boolean memoFunction, FunctionStreamability streamability)
Make a UserFunction object. This method is for internal use.- Overrides:
newUserFunction
in classConfiguration
- Parameters:
memoFunction
- true if the function is to be a memo function, This option is ignored in Saxon-HE.streamability
- the declared streamability of the function- Returns:
- the newly created user-defined function
-
getTypeHierarchy
public TypeHierarchy getTypeHierarchy()
Get the TypeHierarchy: a cache holding type information- Overrides:
getTypeHierarchy
in classProfessionalConfiguration
- Returns:
- the type hierarchy cache
-
setSchemaURIResolver
public void setSchemaURIResolver(SchemaURIResolver resolver)
Set a user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations.- Parameters:
resolver
- the URI resolver used for import schema declarations
-
createValidityReporter
public InvalidityReportGeneratorEE createValidityReporter()
Description copied from class:Configuration
Register a report generator for reporting invalidities detected in the course of schema validation- Overrides:
createValidityReporter
in classConfiguration
- Returns:
- a report generator.
-
makePackageLoader
public PackageLoaderEE makePackageLoader()
Description copied from class:Configuration
Create a package loader, for reloading SEF files, appropriate to the Saxon edition being used- Overrides:
makePackageLoader
in classProfessionalConfiguration
- Returns:
- a package loader
-
newSchemaCompiler
public SchemaCompiler newSchemaCompiler()
Make a SchemaCompiler which can be used to compile schema documents. The initial settings of the SchemaCompiler are a snapshot of the settings in the EnterpriseConfiguration. Other methods in EnterpriseConfiguration provided for the purpose of compiling schemas are retained for compatibility reasons.- Returns:
- a new SchemaCompiler object
- Since:
- 8.9
-
setOccurrenceLimits
public void setOccurrenceLimits(int minimum, int maximum)
Set the occurrence limits to be used when compiling a finite state automaton.- Parameters:
minimum
- The highest value of minOccurs that will be strictly enforced. If the actual value of minOccurs in a schema is higher than this value, it will be treated as if this value had been specified. The default is 100.maximum
- The highest value of maxOccurs that will be strictly enforced. If the actual value of maxOccurs in a schema is higher than this value, it will be treated as if "unbounded" had been specified. The default is 250.
-
getOccurrenceLimits
public int[] getOccurrenceLimits()
Get the occurrence limits previously set using setOccurrenceLimits (or the default)- Returns:
- an array of two integers, the minimum occurrence limit and the maximum occurrence limit
-
getSchemaURIResolver
public SchemaURIResolver getSchemaURIResolver()
Get the user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations; if none has been explicitly set, returns the standard schema URI resolver.- Returns:
- the user-defined SchemaURIResolver if there is one; otherwise the standard schema URI resolver.
-
readSchema
public java.lang.String readSchema(PipelineConfiguration pipe, java.lang.String baseURI, java.lang.String schemaLocation, java.lang.String expected) throws SchemaException
Read a schema from a given schema location- Overrides:
readSchema
in classConfiguration
- Parameters:
pipe
- the PipelineConfigurationbaseURI
- the base URI for resolving relative URIsschemaLocation
- the location "hint" where to find the schema document. Must not be null. The document located may be either an XSD schema document or an SCM compiled schema.expected
- the target namespace expected; null if there is no expectation- Returns:
- the actual target namespace of the schema
- Throws:
SchemaException
- if the schema cannot be read
-
readMultipleSchemas
public void readMultipleSchemas(PipelineConfiguration pipe, java.lang.String baseURI, java.util.Collection<java.lang.String> schemaLocations, java.lang.String expected) throws SchemaException
Read schema documents from a list of schema locations- Overrides:
readMultipleSchemas
in classConfiguration
- Parameters:
pipe
- the pipeline configurationbaseURI
- the base URI for resolving relative URIsschemaLocations
- the list of location "hints" where to find the schema document. Must not be null.expected
- the target namespace expected in each of the schema documents; null if there is no expected namespace- Throws:
SchemaException
- if an error occurs
-
readInlineSchema
public java.lang.String readInlineSchema(NodeInfo root, java.lang.String expected, ErrorReporter errorReporter) throws SchemaException
Read an inline schema from a stylesheet- Overrides:
readInlineSchema
in classConfiguration
- Parameters:
root
- the xs:schema element in the stylesheetexpected
- the target namespace expected; "" if there is no expectationerrorReporter
- The destination for error messages. May be null, in which case the errorListener registered with this Configuration is used.- Returns:
- the actual target namespace of the schema
- Throws:
SchemaException
- if the schema cannot be processed
-
addSchemaSource
public void addSchemaSource(javax.xml.transform.Source schemaSource, ErrorReporter errorReporter) throws SchemaException
Description copied from class:Configuration
Load a schema, which will be available for use by all subsequent operations using this EnterpriseConfiguration.- Overrides:
addSchemaSource
in classConfiguration
- Parameters:
schemaSource
- the JAXP Source object identifying the schema document to be loadederrorReporter
- the ErrorListener to be notified of any errors in the schema.- Throws:
SchemaException
- if the schema cannot be read or parsed or if it is invalid
-
addSchemaSource
public void addSchemaSource(javax.xml.transform.Source schemaSource, ErrorReporter errorReporter, SchemaCompiler compiler) throws SchemaException
Load a schema, which will be available for use by all subsequent operations using this EnterpriseConfiguration.- Parameters:
schemaSource
- the JAXP Source object identifying the schema document to be loaded. This may be either a source schema document in XSD format, or a compiled schema in Saxon's SCM formaterrorReporter
- the ErrorReporter to be notified of any errors in the schema. If null, the configuration's ErrorReporter is used- Throws:
SchemaException
- if the schema cannot be read or parsed or if it is invalid
-
addSchema
public void addSchema(PreparedSchema pschema) throws SchemaException
Add a schema (a collection of schema components) to the cache- Parameters:
pschema
- The schema to be added- Throws:
SchemaException
- if the schema cannot be added because components in the schema are incompatible with components already in the cache
-
addSurrogateSchema
public void addSurrogateSchema(java.lang.String namespace)
Put a temporary schema marker in the cache, to indicate that a schema for a given namespace is being processed. Used to detect circularities.This method is intended for internal use
- Parameters:
namespace
- the target namespace of the schema
-
addSchemaForBuiltInNamespace
public void addSchemaForBuiltInNamespace(java.lang.String namespace)
Add a built-in schema for a given namespace. This is a no-op if the configuration is not schema-aware- Overrides:
addSchemaForBuiltInNamespace
in classConfiguration
- Parameters:
namespace
- the namespace. Currently built-in schemas are available for the XML, XSI, and FN namespaces
-
getNamespaceStatus
public int getNamespaceStatus(java.lang.String namespace)
Get the status of a particular schema namespace.- Parameters:
namespace
- the Namespace URI whose status is required (supply "" for the non-namespace)- Returns:
- one of
PreparedSchema.NAMESPACE_KNOWN
,PreparedSchema.NAMESPACE_UNKNOWN
,PreparedSchema.NAMESPACE_UNDER_CONSTRUCTION
,PreparedSchema.NAMESPACE_SEALED
-
setNamespaceStatus
public void setNamespaceStatus(java.lang.String namespace, int status)
Set the status of a particular schema namespace.- Parameters:
namespace
- the Namespace URI whose status is required (supply "" for the non-namespace)status
- one ofPreparedSchema.NAMESPACE_KNOWN
,PreparedSchema.NAMESPACE_UNKNOWN
,PreparedSchema.NAMESPACE_UNDER_CONSTRUCTION
,PreparedSchema.NAMESPACE_SEALED
-
isSchemaAvailable
public boolean isSchemaAvailable(java.lang.String targetNamespace)
Determine whether the Configuration contains a cached schema for a given target namespace- Overrides:
isSchemaAvailable
in classConfiguration
- Parameters:
targetNamespace
- the target namespace of the schema being sought (supply "" for the unnamed namespace)- Returns:
- true if the schema for this namespace is available, false if not.
-
removeSchema
public void removeSchema(java.lang.String namespace)
Remove the schema for a given namespace. This is done if it is found to be invalid. Note that this does not actually remove the schema components in this namespace; all it does is to mark the namespace as removed, which means that a new attempt to load a schema for this namespace is able to succeed.- Parameters:
namespace
- the namespace of the schema to be removed
-
getImportedNamespaces
public java.util.Set<java.lang.String> getImportedNamespaces()
Get the set of namespaces of imported schemas- Overrides:
getImportedNamespaces
in classConfiguration
- Returns:
- a Set whose members are the namespaces of all schemas in the schema cache, as String objects
-
getSuperSchema
public PreparedSchema getSuperSchema()
Get the SuperSchema, containing references to all names defined in all known schemas- Returns:
- the PreparedSchema containing the schema components for all loaded target namespaces
-
sealNamespace
public void sealNamespace(java.lang.String namespace)
Mark a schema namespace as being sealed. This is done when components from this namespace are first used for validating a source document or compiling a source document or query. Once a namespace has been sealed, it is not permitted to change the schema components in that namespace by redefining them, deriving new types by extension, or adding to their substitution groups.- Overrides:
sealNamespace
in classConfiguration
- Parameters:
namespace
- the namespace URI of the components to be sealed
-
isSealedNamespace
public boolean isSealedNamespace(java.lang.String namespace)
Test whether a schema namespace is sealed. Once a namespace has been sealed, it is not permitted to change the schema components in that namespace by redefining them, deriving new types by extension, or adding to their substitution groups.- Parameters:
namespace
- the namespace URI of the components to be tested. Supply "" for the no-namespace.- Returns:
- true if this namespace has been sealed, otherwise false
-
getDeclaredSchemaParameters
public java.util.Collection<GlobalParam> getDeclaredSchemaParameters()
Get the set of saxon:param schema parameters declared in the schema held by this Configuration.- Overrides:
getDeclaredSchemaParameters
in classConfiguration
- Returns:
- the set of parameters. May return null if none have been declared.
-
getExtensionsOfType
public java.util.Iterator<? extends SchemaType> getExtensionsOfType(SchemaType type)
Get the set of complex types that have been defined as extensions of a given type. Note that we do not seal the schema namespace, so this list is not necessarily final; we must assume that new extensions of built-in simple types can be added at any time- Overrides:
getExtensionsOfType
in classConfiguration
- Parameters:
type
- the type whose extensions are required- Returns:
- an iterator over the types that are derived from the given type by extension
-
importComponents
public void importComponents(javax.xml.transform.Source source) throws XPathException
Import a precompiled Schema Component Model from a given Source. The schema components derived from this schema document are added to the cache of schema components maintained by this SchemaManager- Overrides:
importComponents
in classConfiguration
- Parameters:
source
- the XML file containing the schema component model, as generated by a previous call onConfiguration.exportComponents(net.sf.saxon.event.Receiver)
- Throws:
XPathException
- if an error occurs
-
exportComponents
public void exportComponents(Receiver out) throws XPathException
Export a precompiled Schema Component Model containing all the components (except built-in components) that have been loaded into this Processor.- Overrides:
exportComponents
in classConfiguration
- Parameters:
out
- the destination to recieve the precompiled Schema Component Model in the form of an XML document- Throws:
XPathException
- if a failure occurs
-
clearSchemaCache
public void clearSchemaCache()
Remove all schema components that have been loaded into this Configuration. This method must not be used if any processes (such as stylesheet or query compilations or executions) are currently active. In a multi-threaded environment, it is the user's responsibility to ensure that this method is not called unless it is safe to do so.- Overrides:
clearSchemaCache
in classConfiguration
-
getSchemaAsFunctionItem
public Function getSchemaAsFunctionItem()
Get information about the schema in the form of a function item. Supports the extension function saxon:schema- Overrides:
getSchemaAsFunctionItem
in classConfiguration
- Returns:
- a function item corresponding to the Schema (whole-schema) component
-
getSchemaComponentAsFunctionItem
public Function getSchemaComponentAsFunctionItem(java.lang.String kind, QNameValue name) throws XPathException
Get information about the schema in the form of a function item. Supports the extension function saxon:schema- Overrides:
getSchemaComponentAsFunctionItem
in classConfiguration
- Parameters:
kind
- the component kind, e.g. "element declaration"name
- the component name- Returns:
- a function item corresponding to the selected component, or null if it does not exist.
- Throws:
XPathException
- if the first argument does not identify a valid kind of component
-
getElementDeclaration
public SchemaDeclaration getElementDeclaration(int fingerprint)
Get a global element declaration by fingerprint- Overrides:
getElementDeclaration
in classConfiguration
- Parameters:
fingerprint
- the NamePool fingerprint of the element name- Returns:
- the element declaration whose name matches the given fingerprint, or null if no element declaration with this name has been registered.
-
getElementDeclaration
public SchemaDeclaration getElementDeclaration(StructuredQName qName)
Get a global element declaration by name.- Overrides:
getElementDeclaration
in classConfiguration
- Parameters:
qName
- the name of the required element declaration- Returns:
- the element declaration whose name matches the given name, or null if no element declaration with this name has been registered.
-
getAttributeDeclaration
public SchemaDeclaration getAttributeDeclaration(int fingerprint)
Get a global attribute declaration by fingerprint- Overrides:
getAttributeDeclaration
in classConfiguration
- Parameters:
fingerprint
- the NamePool fingerprint of the element name- Returns:
- the attribute declaration whose name matches the given fingerprint, or null if no element declaration with this name has been registered.
-
getAttributeDeclaration
public SchemaDeclaration getAttributeDeclaration(StructuredQName attributeName)
Get a global attribute declaration by name- Overrides:
getAttributeDeclaration
in classConfiguration
- Parameters:
attributeName
- the name of the required attribute declaration- Returns:
- the attribute declaration whose name matches the given fingerprint, or null if no element declaration with this name has been registered.
-
getSchemaType
public SchemaType getSchemaType(StructuredQName name)
Get the top-level schema type definition with a given QName.- Overrides:
getSchemaType
in classConfiguration
- Parameters:
name
- the name of the required schema type- Returns:
- the schema type , or null if there is none with this name.
- Since:
- 9.7
-
makeUserUnionType
public UserUnionType makeUserUnionType(java.util.List<AtomicType> memberTypes)
Make a union type with a given list of member types- Overrides:
makeUserUnionType
in classConfiguration
- Parameters:
memberTypes
- the member types- Returns:
- the union type with these member types
-
isDeclaredNotation
public boolean isDeclaredNotation(java.lang.String uri, java.lang.String local)
Ask whether a given notation has been declared in the schema- Specified by:
isDeclaredNotation
in interfaceNotationSet
- Overrides:
isDeclaredNotation
in classConfiguration
- Parameters:
uri
- the targetNamespace of the notationlocal
- the local part of the notation name- Returns:
- true if the notation has been declared, false if not
- Since:
- 9.3
-
checkTypeDerivationIsOK
public void checkTypeDerivationIsOK(SchemaType derived, SchemaType base, int block) throws SchemaException
Check that a type is validly derived from another type, following the rules for the Schema Component Constraint "Is Type Derivation OK (Simple)" (3.14.6) or "Is Type Derivation OK (Complex)" (3.4.6) as appropriate.- Overrides:
checkTypeDerivationIsOK
in classConfiguration
- Parameters:
derived
- the derived typebase
- the base type; the algorithm tests whether derivation from this type is permittedblock
- the derivations that are blocked by the relevant element declaration- Throws:
SchemaException
- if the derivation is not allowed
-
prepareValidationReporting
public void prepareValidationReporting(XPathContext context, ParseOptions options)
Set validation reporting options. Called by instructions that invoke validation to set up an appropriate invalidity handler- Overrides:
prepareValidationReporting
in classConfiguration
- Parameters:
context
- the XPath evaluation contextoptions
- the parser options, to be updated
-
getDocumentValidator
public Receiver getDocumentValidator(Receiver receiver, java.lang.String systemId, ParseOptions validationOptions, Location initiatingLocation)
Get a document-level validator to add to a Receiver pipeline- Overrides:
getDocumentValidator
in classConfiguration
- Parameters:
receiver
- The receiver to which events should be sent after validationsystemId
- the base URI of the document being validatedvalidationOptions
- Supplies options relevant to XSD validationinitiatingLocation
- (optional) Location in query or stylesheet of instruction that requested validation- Returns:
- A Receiver to which events can be sent for validation
-
getElementValidator
public Receiver getElementValidator(Receiver receiver, ParseOptions options, Location location) throws XPathException
Get a Receiver that can be used to validate an element, and that passes the validated element on to a target receiver. If validation is not supported, the returned receiver will be the target receiver.- Overrides:
getElementValidator
in classConfiguration
- Parameters:
receiver
- the target receiver to receive the validated element; its pipelineConfiguration must be initialized.options
- options affecting the way schema validation is donelocation
- identifies the location of the element within its source document (or, if preferred, the location of the instruction requesting validation), relative to the LocationProvider in the PipelineConfiguration of the receiver- Returns:
- The newly created receiver, which performs the validation and passes the validated elements on to the target receiver.
- Throws:
XPathException
- if a validator for the element cannot be created
-
validateAttribute
public SimpleType validateAttribute(StructuredQName nodeName, java.lang.CharSequence value, int validation) throws ValidationException, MissingComponentException
Validate an attribute value (XSLT only)- Overrides:
validateAttribute
in classConfiguration
- Parameters:
nodeName
- the name of the attributevalue
- the value of the attribute as a stringvalidation
- STRICT or LAX- Returns:
- an int, containing the type annotation to apply to the attribute node
- Throws:
ValidationException
- if the value is invalidMissingComponentException
-
getAnnotationStripper
public Receiver getAnnotationStripper(Receiver destination)
Add to a pipeline a receiver that strips all type annotations. This has a null implementation in the Saxon-HE product, because type annotations can never arise.- Overrides:
getAnnotationStripper
in classConfiguration
- Parameters:
destination
- the destination for events after stripping type annotations- Returns:
- the type-stripping receiver
-
newExpressionParser
public XPathParser newExpressionParser(java.lang.String language, boolean updating, int languageVersion) throws XPathException
Make an expression Parser for a specified version of XPath or XQuery- Overrides:
newExpressionParser
in classProfessionalConfiguration
- Parameters:
language
- set to "XP" (XPath) or "XQ" (XQuery) or "PATTERN" (XSLT Patterns)updating
- indicates whether or not XQuery update syntax may be used. Note that XQuery Update is supported only in Saxon-EElanguageVersion
- the required version (e.g 10 for "1.0", 30 for "3.0", 31 for "3.1"). In Saxon 9.8, a request for XQuery 1.0 or 3.0 delivers an XQuery 3.1 parser, while the values supported for XPath are 2.0 and 3.1- Returns:
- the QueryParser
- Throws:
XPathException
- if this version of Saxon does not support the requested options
-
newExpressionExporter
public ExpressionPresenter newExpressionExporter(java.lang.String target, java.io.OutputStream destination, StylesheetPackage rootPackage) throws XPathException
Get a new ExpressionPresenter capable of exporting a compiled stylesheet- Overrides:
newExpressionExporter
in classConfiguration
- Parameters:
target
- the target environment, e.g. EE, JSdestination
- the destination for the output filerootPackage
- the compiled stylesheet package- Returns:
- a suitable Expression Presenter
- Throws:
XPathException
- if none is available (e.g. because this is not Saxon-EE)
-
newPendingUpdateList
public PendingUpdateList newPendingUpdateList()
Get a new Pending Update List- Overrides:
newPendingUpdateList
in classConfiguration
- Returns:
- the new Pending Update List
-
makePipelineConfiguration
public PipelineConfiguration makePipelineConfiguration()
Make a PipelineConfiguration from the properties of this Configuration- Overrides:
makePipelineConfiguration
in classConfiguration
- Returns:
- a new PipelineConfiguration
- Since:
- 8.4
-
makeSchemaURIResolver
public SchemaURIResolver makeSchemaURIResolver(javax.xml.transform.URIResolver resolver)
Make a SchemaURIResolver that wraps a supplied URIResolver- Overrides:
makeSchemaURIResolver
in classConfiguration
- Returns:
- a new SchemaURIResolver (or null if this is not an EnterpriseConfiguration)
- Since:
- 10.0
-
makeDocumentProjector
public FilterFactory makeDocumentProjector(PathMap.PathMapRoot map)
Create a document projector for a given path map root. Document projection is available only in Saxon-EE, so the Saxon-HE version of this method throws an exception- Overrides:
makeDocumentProjector
in classConfiguration
- Parameters:
map
- a path map root in a path map. This might represent the call to the initial context item for a query, or it might represent a call on the doc() function. The path map contains information about the paths that the query uses within this document.- Returns:
- a push filter that implements document projection
- Throws:
java.lang.UnsupportedOperationException
- if this is not a schema-aware configuration, or if no Saxon-EE license is available
-
makeDocumentProjector
public FilterFactory makeDocumentProjector(XQueryExpression exp)
Create a document projector for the document supplied as the initial context item in a query. Document projection is available only in Saxon-EE, so the Saxon-HE version of this method throws an exception- Overrides:
makeDocumentProjector
in classConfiguration
- Parameters:
exp
- an XQuery expression. The document projector that is returned will be for the document supplied as the context item to this query.- Returns:
- a push filter that implements document projection
- Throws:
java.lang.UnsupportedOperationException
- if this is not a schema-aware configuration, or if no Saxon-EE license is available
-
getFocusTrackerFactory
public java.util.function.Function<SequenceIterator,FocusTrackingIterator> getFocusTrackerFactory(Executable exec, boolean multithreaded)
Get a factory function that can be used to wrap a SequenceIterator in a FocusTrackingIterator. This is called by theController
to get a default factory function; the value can be overridden by the application usingController.setFocusTrackerFactory(java.util.function.Function)
. TheFocusTrackingIterator
that is created by the factory must be thread-safe if it is to be used for iterating over a sequence where the items might be processed asynchronously usingxsl:result-document
; for this reason this method is overridden for a Saxon-EE configuration.- Overrides:
getFocusTrackerFactory
in classConfiguration
- Parameters:
exec
- the executable; supplied so that the factory can be sensitive to whether calls on xsl:result-document are possiblemultithreaded
- set to true to get a factory suitable for creating focus tracking iterators for a multi-threaded xsl:for-each instruction- Returns:
- a suitable factory function
-
setStreamabilityEnabled
public void setStreamabilityEnabled(boolean enabled)
Set the streamability rules to be applied. Requires an EET license.- Parameters:
enabled
- set to true if streamability checking (using W3C standard rules) is enabled for this configuration. Must be false under Saxon-HE- Since:
- 9.6. Changed in 9.8 to drop support for streamability="extended".
Simplified and renamed (from
setStreamability
) in 10.0
-
isStreamabilityEnabled
public boolean isStreamabilityEnabled()
Ask whether streamability checking is enabled for this configuration- Overrides:
isStreamabilityEnabled
in classConfiguration
- Returns:
- always false for Saxon-HE; for Saxon-EE, true if an appropriate license is installed
-
makeStreamingTransformer
public Receiver makeStreamingTransformer(Mode mode, ParameterSet ordinaryParams, ParameterSet tunnelParams, Outputter out, XPathContext context) throws XPathException
Create a streaming transformer- Overrides:
makeStreamingTransformer
in classConfiguration
- Parameters:
mode
- the initial mode, which must be a streaming modeordinaryParams
- the parameters that are not tunnel parameterstunnelParams
- the tunnel parametersout
- the destination for the transformed documentcontext
- the initial XPath context- Returns:
- a Receiver to which the streamed input document will be pushed
- Throws:
XPathException
- if a streaming transformer cannot be created (which is always the case in Saxon-HE and Saxon-PE)
-
makeStreamInstruction
public Expression makeStreamInstruction(Expression hrefExp, Expression body, boolean streaming, ParseOptions options, PackageData packageData, Location location, RetainedStaticContext rsc) throws XPathException
- Overrides:
makeStreamInstruction
in classConfiguration
- Throws:
XPathException
-
checkStrictStreamability
public void checkStrictStreamability(XSLTemplate template, Expression body) throws XPathException
Check the streamability of a template rule- Overrides:
checkStrictStreamability
in classConfiguration
- Throws:
XPathException
-
isStreamedNode
public boolean isStreamedNode(NodeInfo node)
Ask whether a given node is a streamed node- Overrides:
isStreamedNode
in classConfiguration
- Parameters:
node
- the node in question- Returns:
- true if the node is a node in a streamed document
-
getOptimizerOptions
public OptimizerOptions getOptimizerOptions()
Get the optimization options in use- Overrides:
getOptimizerOptions
in classConfiguration
- Returns:
- the configured optimization options
-
obtainOptimizer
public Optimizer obtainOptimizer()
Factory method to get an Optimizer- Overrides:
obtainOptimizer
in classConfiguration
- Returns:
- the optimizer used in this configuration, which is created if necessary
-
obtainOptimizer
public Optimizer obtainOptimizer(OptimizerOptions options)
Factory method to get an Optimizer with specified optimizer options.This method is intended for internal use only.
- Overrides:
obtainOptimizer
in classConfiguration
- Parameters:
options
- the optimizer options- Returns:
- a new optimizer with the specified options set (provided the optimizations are available in this Saxon configuration)
-
isGenerateByteCode
public boolean isGenerateByteCode(HostLanguage hostLanguage)
Ask whether bytecode should be generated. The default setting is true in Saxon Enterprise Edition and false in all other cases. Setting the option to true has no effect if Saxon-EE is not available (but if it is set to true, this method will return true). Setting the option to false in Saxon-EE is permitted if for some reason bytecode generation is to be suppressed (one possible reason is to improve compilation performance at the expense of evaluation performance).- Overrides:
isGenerateByteCode
in classConfiguration
- Parameters:
hostLanguage
- one of XSLT or XQUERY- Returns:
- true if the option is switched on
-
isDeferredByteCode
public boolean isDeferredByteCode(HostLanguage hostLanguage)
Ask whether bytecode should be generated in Just-In-time compilation and therefore deferring the byte code generation. The default setting is false. Setting the option to true has no effect if Saxon-EE is not available (but if it is set to true, this method will return true). Setting the option to false in Saxon-EE is permitted and therefore byte code generation will be generated in the compile phase.- Overrides:
isDeferredByteCode
in classConfiguration
- Parameters:
hostLanguage
- one of XSLT or XQUERY- Returns:
- true if the option is switched on
-
isJITEnabled
public boolean isJITEnabled()
Description copied from class:Configuration
Ask whether just-in-time compilation of XSLT template rules is in force- Overrides:
isJITEnabled
in classConfiguration
- Returns:
- true if just-in-time compilation is enabled (this is the default in Saxon-EE and not available in other configurations)
-
makeXQueryExpression
public XQueryExpression makeXQueryExpression(Expression exp, QueryModule mainModule, boolean streaming) throws XPathException
Factory method to make an XQueryExpression- Overrides:
makeXQueryExpression
in classConfiguration
- Parameters:
exp
- the expression forming the body of the querymainModule
- the query module containing the expressionstreaming
- true if streamed execution is requested- Returns:
- the XQueryExpression
- Throws:
XPathException
- if an error occurs
-
compileRegularExpression
public RegularExpression compileRegularExpression(java.lang.CharSequence regex, java.lang.String flags, java.lang.String hostLanguage, java.util.List<java.lang.String> warnings) throws XPathException
Description copied from class:Configuration
Compile a regular expression (or, in some configurations, get a compiled regular expression from a cache- Overrides:
compileRegularExpression
in classConfiguration
- Parameters:
regex
- the regular expression as a stringflags
- the value of the flags attributehostLanguage
- one of "XSD10", "XSD11", XP20" or "XP30". Also allow combinations, e.g. "XP20/XSD11".warnings
- if non-null, any warnings from the regular expression compiler will be added to this list. If null, the warnings are ignored.- Returns:
- the compiled regular expression
- Throws:
XPathException
- if the regular expression or the flags are invalid
-
makeSlotManager
public SlotManager makeSlotManager()
Description copied from class:Configuration
Factory method to create a SlotManager.This method is provided for advanced users only, and is subject to change.
- Overrides:
makeSlotManager
in classConfiguration
- Returns:
- a SlotManager (which is a skeletal stack frame representing the mapping of variable names to slots on the stack frame)
-
getResultDocumentThreadsLimit
public int getResultDocumentThreadsLimit()
Get the number of threads to be used for xsl:result-document instructions- Returns:
- the concurrency of asynchronous xsl:result-document threads, defaulting to the number of (hardware) processors/CPUs available
-
processResultDocument
public void processResultDocument(ResultDocument instruction, Expression content, XPathContext context) throws XPathException
Process an xsl:result-document instruction. The Saxon-HE version of this method simply executes the instruction. The Saxon-EE submits the instruction for execution asynchronously in an ExecutorService.- Overrides:
processResultDocument
in classConfiguration
- Parameters:
instruction
- the instruction to be executedcontent
- the expression that defines the content of the new result documentcontext
- the evaluation context- Throws:
XPathException
- if any dynamic error occurs
-
getMultithreadingFactory
public MultithreadingFactory getMultithreadingFactory()
Get the factory class used to handle creation of objects that support multithreaded execution.- Returns:
- a MultithreadingFactory, which might be subclassed by advanced applications
-
setMultithreadingFactory
public void setMultithreadingFactory(MultithreadingFactory factory)
Set a factory class to handle creation of objects that support multithreaded execution.- Parameters:
factory
- a MultithreadingFactory, which can be subclassed by advanced applications
-
getMultithreadedItemMappingIterator
public SequenceIterator getMultithreadedItemMappingIterator(SequenceIterator base, ItemMappingFunction action) throws XPathException
Get an item mapping iterator suitable for multi-threaded execution, if this is permitted- Overrides:
getMultithreadedItemMappingIterator
in classConfiguration
- Parameters:
base
- iterator over the input sequenceaction
- mapping function to be applied to each item in the input sequence.- Returns:
- an iterator over the result sequence
- Throws:
XPathException
- if (for example) a dynamic error occurs while priming the queue
-
makeClosure
public Sequence makeClosure(Expression expression, int ref, XPathContext context) throws XPathException
Make a Closure, given the expected reference count- Overrides:
makeClosure
in classConfiguration
- Parameters:
expression
- the expression to be evaluatedref
- the (nominal) number of times the value of the expression is requiredcontext
- the XPath dynamic evaluation context- Returns:
- the constructed Closure
- Throws:
XPathException
- if a failure occurs constructing the Closure
-
makeSequenceExtent
public GroundedValue makeSequenceExtent(Expression expression, int ref, XPathContext context) throws XPathException
Make a SequenceExtent, given the expected reference count- Overrides:
makeSequenceExtent
in classConfiguration
- Parameters:
expression
- the expression to be evaluatedref
- the (nominal) number of times the value of the expression is requiredcontext
- the XPath dynamic evaluation context- Returns:
- the constructed Closure
- Throws:
XPathException
- if evaluation of the expression fails
-
declareBuiltInExtensionElementNamespaces
public void declareBuiltInExtensionElementNamespaces()
Declare the built-in XSLT extension element namespaces- Overrides:
declareBuiltInExtensionElementNamespaces
in classProfessionalConfiguration
-
makeContextItemStaticInfo
public ContextItemStaticInfo makeContextItemStaticInfo(ItemType itemType, boolean maybeUndefined)
Factory method to make a ContextItemStaticInfo- Overrides:
makeContextItemStaticInfo
in classConfiguration
- Parameters:
itemType
- the item type of the context item. If the context item is absent, set this toErrorType.getInstance()
.maybeUndefined
- set to true if it is possible (or certain) that the context item will be absent.- Returns:
- the ContextItemStaticInfo
-
getDefaultContextItemStaticInfo
public ContextItemStaticInfo getDefaultContextItemStaticInfo()
Get a default ContextItemStaticInfo, indication no information is available about the context item type- Overrides:
getDefaultContextItemStaticInfo
in classConfiguration
- Returns:
- the default ContextItemStaticInfo
-
makeMode
public SimpleMode makeMode(StructuredQName modeName, CompilerInfo compilerInfo)
Make a new Mode - this can be overridden in subclasses to produce optimized variants- Overrides:
makeMode
in classProfessionalConfiguration
- Parameters:
modeName
- the name of the modecompilerInfo
- information on the compiler, that can alter rule optimization- Returns:
- an instantiated Mode
-
makeTemplateRule
public TemplateRuleEE makeTemplateRule()
Factory method to create a Template Rule- Overrides:
makeTemplateRule
in classConfiguration
- Returns:
- a new TemplateRule appropriate to this Configuration
-
makeThreadManager
public XPathContextMajor.ThreadManager makeThreadManager()
Make a ThreadManager for asynchronous xsl:result-document instructions- Overrides:
makeThreadManager
in classConfiguration
- Returns:
- a new ThreadManager (or null in the case of Saxon-HE, or if multithreading is disabled)
-
makeCompilerInfo
public CompilerInfo makeCompilerInfo()
Make an XSLT CompilerInfo object - can be overridden in a subclass to produce variants capable of optimization- Overrides:
makeCompilerInfo
in classConfiguration
- Returns:
- a new CompilerInfo object
-
makeCompilerService
public CompilerService makeCompilerService(HostLanguage hostLanguage)
Make a CompilerService object, to handle byte code generation, or null if byte code generation is not available- Overrides:
makeCompilerService
in classConfiguration
- Parameters:
hostLanguage
- for example Configuration.XSLT- Returns:
- a CompilerService, or null
-
obtainByteCodeMonitor
public ByteCodeMonitor obtainByteCodeMonitor()
Obtain a ByteCodeMonitor for monitoring hotspot bytecode generation- Returns:
- the existing ByteCodeMonitor if there is one, or a new one if not
-
createByteCodeReport
public void createByteCodeReport(java.lang.String fileName)
Generate a report on byte code instrumentation to a specified file- Overrides:
createByteCodeReport
in classConfiguration
- Parameters:
fileName
- the specified file name
-
-