public class JavaPlatform extends Object implements Platform
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(CharSequence regex,
String flags,
String hostLanguage,
List<String> warnings)
Compile a regular expression
|
ClassLoader |
getClassLoaderForGeneratedClass(String definedClassName,
byte[] classFile,
Configuration config,
Class thisClass)
Return the class loader required to load the bytecode generated classes
|
AtomicMatchKey |
getCollationKey(SimpleCollation namedCollation,
String value)
Given a collation, get a collation key.
|
SchemaType |
getExternalObjectType(Configuration config,
String uri,
String localName)
Get a SchemaType representing a wrapped external (Java or .NET) object
|
String |
getInstallationDirectory(String edition,
Configuration config)
Return the name of the directory in which the software is installed (if available)
|
Source |
getParserSource(PipelineConfiguration pipe,
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
|
String |
getPlatformSuffix()
Get a suffix letter to add to the Saxon version number to identify the platform
|
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
|
XMLReader |
loadParser()
Get a parser by instantiating the SAXParserFactory
|
StringCollator |
makeCollation(Configuration config,
Properties props,
String uri)
Obtain a collation with a given set of properties.
|
StringCollator |
makeICUCollator(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()
Set the default XML parser to be loaded by the SAXParserFactory on this platform.
|
public JavaPlatform()
public void initialize(Configuration config)
initialize
in interface Platform
config
- the Saxon Configurationpublic boolean isJava()
public boolean isDotNet()
public String getPlatformVersion()
getPlatformVersion
in interface Platform
public String getPlatformSuffix()
getPlatformSuffix
in interface Platform
public XMLReader loadParser()
loadParser
in interface Platform
public Source getParserSource(PipelineConfiguration pipe, StreamSource input, int validation, boolean dtdValidation, int stripspace)
getParserSource
in interface Platform
pipe
- 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, Properties props, String uri) throws XPathException
makeCollation
in interface Platform
config
- the configuration objectprops
- the desired properties of the collationuri
- the collation URIXPathException
- if a fatal error occurspublic boolean canReturnCollationKeys(StringCollator collation)
canReturnCollationKeys
in interface Platform
collation
- the collation, provided as a Comparatorpublic AtomicMatchKey getCollationKey(SimpleCollation namedCollation, String value)
getCollationKey
in interface Platform
namedCollation
- the collation in usevalue
- the string whose collation key is requiredClassCastException
- 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 Platform
public boolean hasICUNumberer()
Platform
hasICUNumberer
in interface Platform
public StringCollator makeICUCollator(String uri, Configuration config) throws XPathException
makeICUCollator
in interface Platform
uri
- 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(CharSequence regex, String flags, String hostLanguage, List<String> warnings) throws XPathException
compileRegularExpression
in interface Platform
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 SchemaType getExternalObjectType(Configuration config, String uri, String localName)
Platform
getExternalObjectType
in interface Platform
config
- the Saxon Configurationuri
- the namespace URI of the schema typelocalName
- the local name of the schema typepublic String getInstallationDirectory(String edition, Configuration config)
getInstallationDirectory
in interface Platform
edition
- config
- the Saxon configurationpublic void registerAllBuiltInObjectModels(Configuration config)
registerAllBuiltInObjectModels
in interface Platform
public void setDefaultSAXParserFactory()
setDefaultSAXParserFactory
in interface Platform
public ClassLoader getClassLoaderForGeneratedClass(String definedClassName, byte[] classFile, Configuration config, Class thisClass)
Platform
getClassLoaderForGeneratedClass
in interface Platform
definedClassName
- The generated class nameclassFile
- The bytecode of the generated classconfig
- The cThe saxon configurationthisClass
- The class object generatedCopyright (c) 2004-2014 Saxonica Limited. All rights reserved.