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
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 net.sf.saxon.Configuration
booleanFeatures, builtInExtensionLibraryList, defaultStaticQueryContext, defaultXsltCompilerInfo, minimalSchema, optimizer, optimizerOptions, staticContextForSystemFunctions, stringFeatures, typeHierarchy, XML10, XML11, XSD10, XSD11, xsdVersion -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSchemaSource(Source schemaSource, ErrorReporter errorReporter) Load a schema, which will be available for use by all subsequent operations using this EnterpriseConfiguration.voidaddSchemaSource(Source schemaSource, ErrorReporter errorReporter, SchemaCompiler compiler) Load a schema, which will be available for use by all subsequent operations using this EnterpriseConfiguration.addValidatorToPipeline(ParseOptions options, String systemId, Receiver destination) Method to add a schema validator to a pipeline.voidcheckLicensedFeature(int feature, String name, int localLicenseId) Check whether a particular feature is licensed, with a fatal error if it is notvoidcheckStrictStreamability(XSLTemplate template, Expression body) Check the streamability of a template rulevoidcheckTypeDerivationIsOK(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.compileRegularExpression(UnicodeString regex, String flags, String hostLanguage, List<String> warnings) Compile a regular expression (or, in some configurations, get a compiled regular expression from a cacheRegister a report generator for reporting invalidities detected in the course of schema validationvoidDeclare the built-in XSLT extension element namespacesgetAnnotationStripper(Receiver destination) Add to a pipeline a receiver that strips all type annotations.getCachedSchema(NamespaceUri namespace) Get a cached schema.Get the set of saxon:param schema parameters declared in the schema held by this Configuration.Get a default ContextItemStaticInfo, indication no information is available about the context item typeGet the edition code identifying this configuration: "HE", "PE" or "EE"protected ObjectgetFeature(FeatureData feature) Get a property of the configurationgetFocusTrackerFactory(Executable exec, boolean multithreaded) Get a factory function that can be used to wrap a SequenceIterator in a FocusTrackingIterator.Get an item mapping iterator suitable for multi-threaded execution, if this is permittedGet the factory class used to handle creation of objects that support multithreaded execution.intgetNamespaceStatus(NamespaceUri namespace) Get the status of a particular schema namespace.int[]Get the occurrence limits previously set using setOccurrenceLimits (or the default)Get the optimization options in useGet the optimization options permitted in this configurationintGet the number of threads to be used for xsl:result-document instructionsgetSchemaForBuiltInNamespace(NamespaceUri namespace) Add a built-in schema for a given namespace.Get the built-in schema for the FN namespacegetSchemaForUuid(String uuid) Get the built-in schema for the XML namespaceGet the built-in schema for the XSI namespaceGet the user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations; if none has been explicitly set, returns the standard schema URI resolver.Create a function library for Saxon-defined extension functions available in Enterprise EditiongetXsdValidatorFunction(BuiltInFunctionSet.Entry details, int arity) integrateSchema(PreparedSchema newSchema) Integrate a new schema.booleanAsk whether just-in-time compilation of XSLT template rules is in forcebooleanisSchemaAvailable(NamespaceUri targetNamespace) Determine whether the Configuration contains a cached schema for a given target namespacebooleanAsk whether streamability checking is enabled for this configurationbooleanisStreamedNode(NodeInfo node) Ask whether a given node is a streamed nodeloadSchema(String absoluteURI) Simple interface to load a schema document.loadStubFunctionLibrary(StreamSource jsonSignatures) Factory method to make the AccumulatorManager, used for static information about the accumulators used in a particular packagemakeContextItemStaticInfo(ItemType itemType) makeContextItemStaticInfo(ItemType itemType, Optionality optionality) Factory method to make a ContextItemStaticInfomakeContextItemStaticInfo(SequenceType sequenceType) makeContextItemStaticInfo(SequenceType seqType, Optionality optionality) makeMode(StructuredQName modeName, CompilerInfo compilerInfo) Make a new Mode - this can be overridden in subclasses to produce optimized variantsCreate a package loader, for reloading SEF files, appropriate to the Saxon edition being usedmakeSchemaURIResolver(ResourceResolver resolver) Make a SchemaURIResolver that wraps a supplied URIResolvermakeSequenceExtent(Expression expression, int ref, XPathContext context) Make a SequenceExtent, given the expected reference countFactory method to create a SlotManager.protected StaticQueryContextmakeStaticQueryContext(boolean copyFromDefault) Make a new static query context object using the factory registered with this configurationmakeStreamingTransformer(Mode mode, ParameterSet ordinaryParams, ParameterSet tunnelParams, Outputter out, XPathContext context) Create a streaming transformermakeStreamInstruction(Expression hrefExp, Expression body, boolean streaming, ParseOptions options, PackageData packageData, Location location, RetainedStaticContext rsc) makeStyleNodeFactory(Compilation compilation) Factory method to make a StyleNodeFactory, used for constructing elements in a stylesheet documentFactory method to make a StylesheetPackageFactory method to create a Template RuleMake a ThreadManager for asynchronous xsl:result-document instructionsmakeUserUnionType(List<AtomicType> memberTypes) Make a union type with a given list of member typesmakeXQueryExpression(Expression exp, QueryModule mainModule, boolean streaming) Factory method to make an XQueryExpressionmakeXsdCompiler(Processor proc) Create an XsdCompiler.protected voidThrow an error indicating that a request cannot be satisfied because it requires the enterprise edition of Saxon.newExpressionExporter(String target, OutputStream destination, StylesheetPackage rootPackage) Get a new ExpressionPresenter capable of exporting a compiled stylesheetnewExpressionParser(String language, boolean updating, StaticContext env) Make an expression Parser for a specified version of XPath or XQuerynewPendingUpdateList(Schema schema) Get a new Pending Update ListMake a SchemaCompiler which can be used to compile schema documents.newUserFunction(boolean memoFunction, FunctionStreamability streamability) Make a UserFunction object.Factory method to get an OptimizerobtainOptimizer(OptimizerOptions options) Factory method to get an Optimizer with specified optimizer options.voidprepareValidationReporting(XPathContext context, ParseOptions options) Set validation reporting options.voidprocessResultDocument(ResultDocument instruction, PushEvaluator content, XPathContext context) Process an xsl:result-document instruction.voidsetCachedSchema(NamespaceUri namespace, PreparedSchema schema) Set a cached schema.protected voidsetFeature(FeatureData feature, Object value) Set a property of the configuration.protected voidvoidSet a factory class to handle creation of objects that support multithreaded execution.voidsetNamespaceStatus(NamespaceUri namespace, int status) Set the status of a particular schema namespace.voidsetOccurrenceLimits(int minimum, int maximum) Set the occurrence limits to be used when compiling a finite state automaton.voidsetSchemaURIResolver(SchemaURIResolver resolver) Set a user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations.voidsetStreamabilityEnabled(boolean enabled) Set the streamability rules to be applied.protected booleantestFeature(int feature) Determine if a particular feature is licensed.Methods inherited from class com.saxonica.config.ProfessionalConfiguration
addExtensionBinders, bindSaxonExtensionFunction, declareBuiltInExtensionFunctions, disableLicensing, displayLicenseMessage, externalObjectAsMap, forceLoadLicense, getBuiltInRecordType, getExtensionBinder, getExtensionElementCreator, getFeature, getLicenseFeature, getLicenseFeatures, getSystemFunction, getTypeHierarchy, getUseWhenFunctionLibrary, getXPathFunctionSet, getXQueryUpdateFunctionSet, getXSLTFunctionSet, importLicenseDetails, isExtensionElementAvailable, isFeatureAllowedBySecondaryLicense, isLicensedFeature, isLicenseFound, isLicenseNotFound, loadLicense, makeBuiltInExtensionLibraryList, makeConfigurationReader, makeMethodMap, makeObjectLookupExpression, makeProfessionalConfiguration, makeSystemFunction, makeSystemFunction40, registerLocalLicense, reportIfMissingLicenseFeature, resolveSource, setConfigurationProperty, setExtensionBinder, setExtensionElementCreator, setExtensionElementNamespace, setExtensionElementNamespace, supplyLicenseKeyMethods inherited from class net.sf.saxon.Configuration
addSchemaSource, buildDocumentTree, buildDocumentTree, clearExternalObjectModels, clearSchemaCache, close, deregisterExternalObjectModel, disableFunction, emptySchema, getBooleanProperty, getBuiltInExtensionLibraryList, getCharacterSetFactory, getClass, getCollation, getCollation, getCollation, getCollationURIResolver, getCollectionFinder, getConfiguration, getConfigurationProperty, getConfigurationProperty, getConversionContext, getConversionRules, getDebugger, getDefaultCollationName, getDefaultCollection, getDefaultCountry, getDefaultLanguage, getDefaultRegexEngine, getDefaultSerializationProperties, getDefaultStaticQueryContext, getDefaultXsltCompilerInfo, getDocumentNumberAllocator, getDynamicLoader, getExternalObjectModel, getExternalObjectModel, getExternalObjectModels, getFunctionAnnotationHandler, getGlobalDocumentPool, getImportedNamespaces, getInstance, getIntegratedFunctionLibrary, getLabel, getLocalizerFactory, getLogger, getMapSpecVersion, getMediaQueryEvaluator, getMediaTypeForFileExtension, getModuleURIResolver, getNamePool, getOutputURIResolver, getParseOptions, getProcessor, getProductTitle, getProtocolRestrictor, getRegisteredCollection, getResourceFactoryForMediaType, getResourceResolver, getSchemaValidationMode, getSerializerFactory, getSourceParser, getSourceParserClass, getSourceResolver, getStandardModuleURIResolver, getStyleParser, getStyleParserClass, getTraceListener, getTraceListenerClass, getTraceListenerOutputFile, getTreeModel, getTreeStatistics, getTypeChecker, getUnparsedTextURIResolver, getValidCharacterChecker, getXMLVersion, getXsdVersion, init, instantiateClassName, instantiateConfiguration, internalSetBooleanProperty, isAssertionsEnabled, isCompatible, isCompileWithTracing, isDisabledFunction, isExpandAttributeDefaults, isLineNumbering, isStripsAllWhiteSpace, isTiming, isValidation, isValidationWarnings, isXIncludeAware, makeDeepLookupExpression, makeEmitter, makeErrorReporter, makeLicensedConfiguration, makeLookupExpression, makeNumberer, makeParser, makePipelineConfiguration, makeResourceResolver, makeSystemFunction, makeTraceListener, makeTraceListener, makeTypeAliasManager, newConfiguration, newLicensedConfiguration, newStaticQueryContext, obtainDefaultSerializationProperties, readConfiguration, readConfiguration, readConfigurationFile, readConfigurationFile, registerCleanupAction, registerCollation, registerCollection, registerExtensionFunction, registerExternalObjectModel, registerFileExtension, registerFunctionAnnotationHandler, registerMediaType, reportFatalError, requireBoolean, requireInteger, requireProfessionalLicense, requireString, reuseSourceParser, reuseStyleParser, setBooleanProperty, setBooleanProperty, setCollationURIResolver, setCollectionFinder, setCompileWithTracing, setConfigurationProperty, setConversionRules, setDebugger, setDefaultCollection, setDefaultCountry, setDefaultLanguage, setDefaultRegexEngine, setDefaultSerializationProperties, setDocumentNumberAllocator, setDynamicLoader, setErrorReporterFactory, setExpandAttributeDefaults, setLabel, setLineNumbering, setLocalizerFactory, setLogger, setMediaQueryEvaluator, setModuleURIResolver, setModuleURIResolver, setNamePool, setOutputURIResolver, setParameterizedURIResolver, setParseOptions, setProcessor, setResourceResolver, setSchemaValidationMode, setSerializerFactory, setSourceParserClass, setSourceResolver, setStaticQueryContextFactory, setStyleParserClass, setTiming, setTraceListener, setTraceListenerClass, setTraceListenerOutputFile, setTreeModel, setUnparsedTextURIResolver, setValidation, setValidationWarnings, setXIncludeAware, setXMLVersion, unravel
-
Constructor Details
-
EnterpriseConfiguration
public EnterpriseConfiguration()Create an EnterpriseConfiguration
-
-
Method Details
-
makeStaticQueryContext
Description copied from class:ConfigurationMake a new static query context object using the factory registered with this configuration- Overrides:
makeStaticQueryContextin 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
Get the edition code identifying this configuration: "HE", "PE" or "EE"- Overrides:
getEditionCodein classProfessionalConfiguration- Returns:
- the code identifying the Saxon edition associated with this configuration
-
setFeature
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:
setFeaturein classProfessionalConfiguration- Parameters:
feature- the property to be set. See the classFeaturefor constants representing the properties that can be set.value- the value of the property- Throws:
IllegalArgumentException- if the property name is not recognized or if the value is not a valid value for the named property
-
getFeature
Get a property of the configuration- Overrides:
getFeaturein classConfiguration- Parameters:
feature- the required property. See the classFeaturefor constants representing the property names that can be requested.- Returns:
- the value of the property
- Throws:
IllegalArgumentException- thrown if the property is not one that Saxon recognizes.
-
checkLicensedFeature
public void checkLicensedFeature(int feature, String name, int localLicenseId) throws LicenseException Check whether a particular feature is licensed, with a fatal error if it is not- Overrides:
checkLicensedFeaturein classProfessionalConfiguration- Parameters:
feature- the feature in question, identified by a constant in classConfiguration.LicenseFeaturename- 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:
setLicensedFeaturesin 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:
testFeaturein 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:
needEnterpriseEditionin classConfiguration
-
makeStyleNodeFactory
Factory method to make a StyleNodeFactory, used for constructing elements in a stylesheet document- Overrides:
makeStyleNodeFactoryin classProfessionalConfiguration- Parameters:
compilation- the compilation episode (compiling one XSLT package)- Returns:
- the StyleNodeFactory used in this Configuration
-
makeStylesheetPackage
Factory method to make a StylesheetPackage- Overrides:
makeStylesheetPackagein classConfiguration- Returns:
- a StylesheetPackage suitable for use in this Configuration
-
makeAccumulatorRegistry
Factory method to make the AccumulatorManager, used for static information about the accumulators used in a particular package- Overrides:
makeAccumulatorRegistryin classConfiguration- Returns:
- a new AccumulatorManager appropriate to this Configuration
-
getVendorFunctionSet
Create a function library for Saxon-defined extension functions available in Enterprise Edition- Overrides:
getVendorFunctionSetin classProfessionalConfiguration- Returns:
- the new function library
-
newUserFunction
Make a UserFunction object. This method is for internal use.- Overrides:
newUserFunctionin 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
-
setSchemaURIResolver
Set a user-defined SchemaURIResolver for resolving URIs used in "import schema" declarations. This acts as a default for anyXsdCompilercreated from this point on.- Parameters:
resolver- the URI resolver used for import schema declarations
-
createValidityReporter
Description copied from class:ConfigurationRegister a report generator for reporting invalidities detected in the course of schema validation- Overrides:
createValidityReporterin classConfiguration- Returns:
- a report generator.
-
makePackageLoader
Description copied from class:ConfigurationCreate a package loader, for reloading SEF files, appropriate to the Saxon edition being used- Overrides:
makePackageLoaderin classProfessionalConfiguration- Returns:
- a package loader
-
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
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. This returns the default setting used when creating a newXsdCompiler; it is not affected by subsequent calls toXsdCompiler.setSchemaURIResolver(SchemaURIResolver).- Returns:
- the user-defined SchemaURIResolver if there is one; otherwise the standard schema URI resolver.
-
loadSchema
Simple interface to load a schema document. This method has no effect on the state of the Configuration.- Overrides:
loadSchemain classConfiguration- Parameters:
absoluteURI- the absolute URI of the location of the schema document- Returns:
- the compiled schema
- Throws:
SchemaException- if the schema document at the given location cannot be read or is invalid
-
addSchemaSource
public void addSchemaSource(Source schemaSource, ErrorReporter errorReporter) throws SchemaException Load a schema, which will be available for use by all subsequent operations using this EnterpriseConfiguration.- Overrides:
addSchemaSourcein classConfiguration- 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
-
getSchemaForBuiltInNamespace
Add a built-in schema for a given namespace. This is a no-op if the configuration is not schema-aware- Overrides:
getSchemaForBuiltInNamespacein classConfiguration- Parameters:
namespace- the namespace. Currently built-in schemas are available for the XML and FN namespaces
-
addSchemaSource
public void addSchemaSource(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 ErrorListener to be notified of any errors in the schema. If null, the configuration's errorListener is usedcompiler- the schema compiler to be used. This allows a cache of schema documents (retained by the schema compiler) to be reused when compiling multiple schema documents. See bug #4982.- Throws:
SchemaException- if the schema cannot be read or parsed or if it is invalid
-
getNamespaceStatus
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
-
setNamespaceStatus
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
-
isSchemaAvailable
Determine whether the Configuration contains a cached schema for a given target namespace- Overrides:
isSchemaAvailablein 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.
-
getCachedSchema
Get a cached schema. Note, this is currently used only for built-in schemas for namespaces such as FN, XML, XSI- Parameters:
namespace- the target namespace- Returns:
- the schema for the namespace if available
-
setCachedSchema
Set a cached schema. Note, this is currently used only for built-in schemas for namespaces such as FN, XML, XSI- Parameters:
namespace- the target namespace
-
integrateSchema
Integrate a new schema. The new schema is compared with existing schemas known to the configuration. If it exactly matches an existing schema, that schema is returned, so we avoid having multiple instances of the same schema. If it conflicts with an existing schema (for example, if we have a conflicting definition of the same named type), we throw an exception. If there is no overlap, we return the supplied schema unchanged, having registered it for comparison with future schemas.- Parameters:
newSchema- the new schema to be integrated- Returns:
- the supplied schema if there are no conflicts, or an existing schema if it is an exact duplicate
- Throws:
SchemaException- if the schema conflicts with an existing schema.
-
getSchemaForUuid
-
getDeclaredSchemaParameters
Get the set of saxon:param schema parameters declared in the schema held by this Configuration.- Overrides:
getDeclaredSchemaParametersin classConfiguration- Returns:
- the set of parameters. May return null if none have been declared.
-
getSchemaForXmlNamespace
Get the built-in schema for the XML namespace- Returns:
- the built-in schema for the XML namespace
-
getSchemaForXsiNamespace
Get the built-in schema for the XSI namespace- Returns:
- the built-in schema for the XSI namespace
-
getSchemaForFnNamespace
Get the built-in schema for the FN namespace- Returns:
- the built-in schema for the XSI namespace
-
getXsdValidatorFunction
- Overrides:
getXsdValidatorFunctionin classConfiguration
-
addValidatorToPipeline
public Receiver addValidatorToPipeline(ParseOptions options, String systemId, Receiver destination) throws XPathException Description copied from class:ConfigurationMethod to add a schema validator to a pipeline. Non-trivial implementation appears in EnterpriseConfiguration class- Overrides:
addValidatorToPipelinein classConfiguration- Parameters:
options- the parser optionssystemId- used as base URIdestination- the destination of the pipeline- Returns:
- in this implementation, the destination unchanged
- Throws:
XPathException- if the attempt to get a schema validator fails
-
loadStubFunctionLibrary
- Overrides:
loadStubFunctionLibraryin classConfiguration- Throws:
XPathException
-
makeUserUnionType
Make a union type with a given list of member types- Overrides:
makeUserUnionTypein classConfiguration- Parameters:
memberTypes- the member types- Returns:
- the union type with these member types
-
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:
checkTypeDerivationIsOKin 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
Set validation reporting options. Called by instructions that invoke validation to set up an appropriate invalidity handler- Overrides:
prepareValidationReportingin classConfiguration- Parameters:
context- the XPath evaluation contextoptions- the parser options, to be updated
-
getAnnotationStripper
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:
getAnnotationStripperin classConfiguration- Parameters:
destination- the destination for events after stripping type annotations- Returns:
- the type-stripping receiver
-
newExpressionParser
public XPathParser newExpressionParser(String language, boolean updating, StaticContext env) throws XPathException Make an expression Parser for a specified version of XPath or XQuery- Overrides:
newExpressionParserin 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-EEenv-- Returns:
- the QueryParser
- Throws:
XPathException- if this version of Saxon does not support the requested options
-
newExpressionExporter
public ExpressionPresenter newExpressionExporter(String target, OutputStream destination, StylesheetPackage rootPackage) throws XPathException Get a new ExpressionPresenter capable of exporting a compiled stylesheet- Overrides:
newExpressionExporterin classConfiguration- Parameters:
target- the target environment, e.g. EE, JS. For export to SaxonJS the values JS2 and JS3 are recognised to distinguish the target versiondestination- 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
Get a new Pending Update List- Overrides:
newPendingUpdateListin classConfiguration- Returns:
- the new Pending Update List
-
makeSchemaURIResolver
Make a SchemaURIResolver that wraps a supplied URIResolver- Overrides:
makeSchemaURIResolverin classConfiguration- Parameters:
resolver- the resolver to be used- Returns:
- a new SchemaURIResolver (or null if this is not an EnterpriseConfiguration)
- Since:
- 10.0
-
getFocusTrackerFactory
public 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 theControllerto get a default factory function; the value can be overridden by the application usingController.setFocusTrackerFactory(java.util.function.Function). TheFocusTrackingIteratorthat 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:
getFocusTrackerFactoryin 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:
isStreamabilityEnabledin 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:
makeStreamingTransformerin 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:
makeStreamInstructionin classConfiguration- Throws:
XPathException
-
checkStrictStreamability
Check the streamability of a template rule- Overrides:
checkStrictStreamabilityin classConfiguration- Parameters:
template- the xsl:template element in the stylesheet treebody- of the compiled body of the template rule- Throws:
XPathException- if streamability problems are found
-
isStreamedNode
Ask whether a given node is a streamed node- Overrides:
isStreamedNodein classConfiguration- Parameters:
node- the node in question- Returns:
- true if the node is a node in a streamed document
-
getOptimizerOptions
Get the optimization options in use- Overrides:
getOptimizerOptionsin classConfiguration- Returns:
- the configured optimization options
-
getPermittedOptimizerOptions
Get the optimization options permitted in this configuration- Overrides:
getPermittedOptimizerOptionsin classConfiguration- Returns:
- the permitted optimization options
-
obtainOptimizer
Factory method to get an Optimizer- Overrides:
obtainOptimizerin classConfiguration- Returns:
- the optimizer used in this configuration, which is created if necessary
-
obtainOptimizer
Factory method to get an Optimizer with specified optimizer options.This method is intended for internal use only.
- Overrides:
obtainOptimizerin classConfiguration- Parameters:
options- the optimizer options- Returns:
- a new optimizer with the specified options set (provided the optimizations are available in this Saxon configuration)
-
isJITEnabled
public boolean isJITEnabled()Description copied from class:ConfigurationAsk whether just-in-time compilation of XSLT template rules is in force- Overrides:
isJITEnabledin 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:
makeXQueryExpressionin 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(UnicodeString regex, String flags, String hostLanguage, List<String> warnings) throws XPathException Description copied from class:ConfigurationCompile a regular expression (or, in some configurations, get a compiled regular expression from a cache- Overrides:
compileRegularExpressionin classConfiguration- Parameters:
regex- the regular expression as a stringflags- the value of the flags attributehostLanguage- one of "XSD10", "XSD11", XP20", "XP30", "XP40". 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
Description copied from class:ConfigurationFactory method to create a SlotManager.This method is provided for advanced users only, and is subject to change.
- Overrides:
makeSlotManagerin 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, PushEvaluator 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:
processResultDocumentin 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
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
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:
getMultithreadedItemMappingIteratorin 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
-
makeSequenceExtent
public GroundedValue makeSequenceExtent(Expression expression, int ref, XPathContext context) throws XPathException Make a SequenceExtent, given the expected reference count- Overrides:
makeSequenceExtentin 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:
declareBuiltInExtensionElementNamespacesin classProfessionalConfiguration
-
makeContextItemStaticInfo
Factory method to make a ContextItemStaticInfo- Overrides:
makeContextItemStaticInfoin classConfiguration- Parameters:
itemType- the item type of the context item. If the context item is absent, set this toErrorType.getInstance().optionality- indicates whether the context item is present, absent, or optional- Returns:
- the ContextItemStaticInfo
-
makeContextItemStaticInfo
public ContextItemStaticInfo makeContextItemStaticInfo(SequenceType seqType, Optionality optionality) - Overrides:
makeContextItemStaticInfoin classConfiguration
-
makeContextItemStaticInfo
- Overrides:
makeContextItemStaticInfoin classConfiguration
-
makeContextItemStaticInfo
- Overrides:
makeContextItemStaticInfoin classConfiguration
-
getDefaultContextItemStaticInfo
Get a default ContextItemStaticInfo, indication no information is available about the context item type- Overrides:
getDefaultContextItemStaticInfoin classConfiguration- Returns:
- the default ContextItemStaticInfo
-
makeMode
Make a new Mode - this can be overridden in subclasses to produce optimized variants- Overrides:
makeModein classProfessionalConfiguration- Parameters:
modeName- the name of the modecompilerInfo- information on the compiler, that can alter rule optimization- Returns:
- an instantiated Mode
-
makeTemplateRule
Factory method to create a Template Rule- Overrides:
makeTemplateRulein classConfiguration- Returns:
- a new TemplateRule appropriate to this Configuration
-
makeThreadManager
Make a ThreadManager for asynchronous xsl:result-document instructions- Overrides:
makeThreadManagerin classConfiguration- Returns:
- a new ThreadManager (or null in the case of Saxon-HE, or if multithreading is disabled)
-
makeXsdCompiler
Description copied from class:ConfigurationCreate an XsdCompiler. This method throws an exception if called on a non-schema-aware configuration.- Overrides:
makeXsdCompilerin classConfiguration- Parameters:
proc- the s9api processor- Returns:
- an XsdCompiler, if the Configuration is a licensed Saxon-EE configuration
-