public class JavaPlatform extends java.lang.Object implements Platform
| Modifier and Type | Class and Description |
|---|---|
static class |
JavaPlatform.MyClassLoader
MyClassLoader.
|
| Constructor and Description |
|---|
JavaPlatform()
The constructor is called during the static initialization of the Configuration
|
| Modifier and Type | Method and Description |
|---|---|
void |
addFunctionLibraries(FunctionLibraryList list,
Configuration config,
int hostLanguage)
Add the platform-specific function libraries to a function library list.
|
boolean |
canReturnCollationKeys(StringCollator collation)
Given a collation, determine whether it is capable of returning collation keys.
|
RegularExpression |
compileRegularExpression(Configuration config,
java.lang.CharSequence regex,
java.lang.String flags,
java.lang.String hostLanguage,
java.util.List<java.lang.String> warnings)
Compile a regular expression
|
AtomicMatchKey |
getCollationKey(SimpleCollation namedCollation,
java.lang.String value)
Given a collation, get a collation key.
|
ExternalObjectType |
getExternalObjectType(Configuration config,
java.lang.String uri,
java.lang.String localName)
Get a SchemaType representing a wrapped external (Java or .NET) object
|
java.lang.String |
getInstallationDirectory(java.lang.String edition,
Configuration config)
Return the name of the directory in which the software is installed (if available)
|
javax.xml.transform.Source |
getParserSource(PipelineConfiguration pipe,
javax.xml.transform.stream.StreamSource input,
int validation,
boolean dtdValidation,
int stripspace)
Convert a StreamSource to either a SAXSource or a PullSource, depending on the native
parser of the selected platform
|
java.lang.String |
getPlatformSuffix()
Get a suffix letter to add to the Saxon version number to identify the platform
|
java.lang.String |
getPlatformVersion()
Get the platform version
|
boolean |
hasICUCollator()
No ICU features
|
boolean |
hasICUNumberer()
Indicate whether the ICU library is available and supports Numberers
|
void |
initialize(Configuration config)
Perform platform-specific initialization of the configuration
|
boolean |
isDotNet()
Return true if this is the .NET platform
|
boolean |
isJava()
Return true if this is the Java platform
|
boolean |
JAXPStaticContextCheck(RetainedStaticContext retainedStaticContext,
StaticContext sc)
Checks if the supplied static context is an instance of the JAXP static context.
|
org.xml.sax.XMLReader |
loadParser()
Get a parser by instantiating the SAXParserFactory
|
java.lang.ClassLoader |
makeClassLoader(Configuration config,
java.lang.Class thisClass)
Return the class loader required to load the bytecode generated classes
|
StringCollator |
makeCollation(Configuration config,
java.util.Properties props,
java.lang.String uri)
Obtain a collation with a given set of properties.
|
ModuleURIResolver |
makeStandardModuleURIResolver(Configuration config)
Make an instance of the default module URI resolver for this platform
|
StringCollator |
makeUcaCollator(java.lang.String uri,
Configuration config)
If available, make a collation using the ICU-J Library
|
void |
registerAllBuiltInObjectModels(Configuration config)
Register all the external object models that are provided as standard
with the relevant edition of Saxon for this Configuration
|
void |
setDefaultSAXParserFactory(Configuration config)
Set the default XML parser to be loaded by the SAXParserFactory on this platform.
|
public JavaPlatform()
public boolean JAXPStaticContextCheck(RetainedStaticContext retainedStaticContext, StaticContext sc)
JAXPStaticContextCheck in interface PlatformretainedStaticContext - sc - public void initialize(Configuration config)
initialize in interface Platformconfig - the Saxon Configurationpublic boolean isJava()
public boolean isDotNet()
public java.lang.String getPlatformVersion()
getPlatformVersion in interface Platformpublic java.lang.String getPlatformSuffix()
getPlatformSuffix in interface Platformpublic org.xml.sax.XMLReader loadParser()
loadParser in interface Platformpublic javax.xml.transform.Source getParserSource(PipelineConfiguration pipe, javax.xml.transform.stream.StreamSource input, int validation, boolean dtdValidation, int stripspace)
getParserSource in interface Platformpipe - the pipeline configurationinput - the supplied StreamSourcevalidation - indicates whether schema validation is requireddtdValidation - indicates whether DTD validation is requiredstripspace - indicates whether whitespace text nodes should be strippedpublic StringCollator makeCollation(Configuration config, java.util.Properties props, java.lang.String uri) throws XPathException
makeCollation in interface Platformconfig - the configuration objectprops - the desired properties of the collationuri - the collation URIXPathException - if a fatal error occurspublic boolean canReturnCollationKeys(StringCollator collation)
canReturnCollationKeys in interface Platformcollation - the collation, provided as a Comparatorpublic AtomicMatchKey getCollationKey(SimpleCollation namedCollation, java.lang.String value)
getCollationKey in interface PlatformnamedCollation - the collation in usevalue - the string whose collation key is requiredjava.lang.ClassCastException - if the collation is not one that is capable of supplying
collation keys (this should have been checked in advance)public boolean hasICUCollator()
hasICUCollator in interface Platformpublic boolean hasICUNumberer()
PlatformhasICUNumberer in interface Platformpublic StringCollator makeUcaCollator(java.lang.String uri, Configuration config) throws XPathException
makeUcaCollator in interface Platformuri - the collation URI (which will always be a UCA collation URI as defined in XSLT 3.0)config - the Saxon configurationXPathException - if the URI is malformed in some waypublic RegularExpression compileRegularExpression(Configuration config, java.lang.CharSequence regex, java.lang.String flags, java.lang.String hostLanguage, java.util.List<java.lang.String> warnings) throws XPathException
compileRegularExpression in interface Platformconfig - 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 supplied, may capture warnings from the regular expression compilerXPathException - if the regular expression or the flags are invalidpublic void addFunctionLibraries(FunctionLibraryList list, Configuration config, int hostLanguage)
list - the function library list that is to be extendedconfig - the ConfigurationhostLanguage - the host language, for example Configuration.XQUERYpublic ExternalObjectType getExternalObjectType(Configuration config, java.lang.String uri, java.lang.String localName)
PlatformgetExternalObjectType in interface Platformconfig - the Saxon Configurationuri - the namespace URI of the schema typelocalName - the local name of the schema typepublic java.lang.String getInstallationDirectory(java.lang.String edition,
Configuration config)
getInstallationDirectory in interface Platformedition - config - the Saxon configurationpublic void registerAllBuiltInObjectModels(Configuration config)
registerAllBuiltInObjectModels in interface Platformpublic void setDefaultSAXParserFactory(Configuration config)
setDefaultSAXParserFactory in interface Platformpublic ModuleURIResolver makeStandardModuleURIResolver(Configuration config)
PlatformmakeStandardModuleURIResolver in interface Platformpublic java.lang.ClassLoader makeClassLoader(Configuration config, java.lang.Class thisClass)
makeClassLoader in interface Platformconfig - The saxon configurationthisClass - The class object generatedCopyright (c) 2004-2018 Saxonica Limited. All rights reserved.