Package net.sf.saxon
Interface Platform
-
- All Superinterfaces:
java.io.Serializable
- All Known Implementing Classes:
JavaPlatform
public interface Platform extends java.io.SerializableThis interface provides access to methods whose implementation depends on the chosen platform (typically Java or .NET)
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidaddFunctionLibraries(FunctionLibraryList list, Configuration config)Add platform-specific function libraries to the function library listbooleancanReturnCollationKeys(java.util.Comparator collation)Given a collation, determine whether it is capable of returning collation keys.RegularExpressioncompileRegularExpression(java.lang.CharSequence regex, boolean isXPath, java.lang.CharSequence flags)Create a compiled regular expressionjava.lang.ObjectgetCollationKey(java.util.Comparator collation, java.lang.String value)Given a collation, get a collation key.SchemaTypegetExternalObjectType(java.lang.String uri, java.lang.String localName)javax.xml.transform.SourcegetParserSource(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 platformjava.lang.StringgetPlatformSuffix()Get a suffix letter to add to the Saxon version number to identify the platformjava.lang.StringgetPlatformVersion()Get the platform versionvoidinitialize(Configuration config)Perform platform-specific initialization of the configurationjava.net.URImakeAbsolute(java.lang.String relativeURI, java.lang.String base)Construct an absolute URI from a relative URI and a base URIjava.util.ComparatormakeCollation(Configuration config, java.util.Properties props)Obtain a collation with a given set of properties.
-
-
-
Method Detail
-
initialize
void initialize(Configuration config)
Perform platform-specific initialization of the configuration
-
makeAbsolute
java.net.URI makeAbsolute(java.lang.String relativeURI, java.lang.String base) throws java.net.URISyntaxExceptionConstruct an absolute URI from a relative URI and a base URI- Parameters:
relativeURI- the relative URIbase- the base URI- Returns:
- the absolutized URI
- Throws:
java.net.URISyntaxException
-
getPlatformVersion
java.lang.String getPlatformVersion()
Get the platform version
-
getPlatformSuffix
java.lang.String getPlatformSuffix()
Get a suffix letter to add to the Saxon version number to identify the platform
-
getParserSource
javax.xml.transform.Source getParserSource(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- Parameters:
input- the supplied StreamSourcevalidation-dtdValidation-stripspace-- Returns:
- the PullSource or SAXSource, initialized with a suitable parser, or the original input Source, if now special handling is required or possible
-
compileRegularExpression
RegularExpression compileRegularExpression(java.lang.CharSequence regex, boolean isXPath, java.lang.CharSequence flags) throws XPathException
Create a compiled regular expression- Parameters:
regex- the source text of the regular expression, in XML Schema or XPath syntaxisXPath- set to true if this is an XPath regular expression, false if it is XML Schemaflags- the flags argument as supplied to functions such as fn:matches(), in string form- Returns:
- the compiled regular expression
- Throws:
XPathException- if the syntax of the regular expression or flags is incorrect
-
makeCollation
java.util.Comparator makeCollation(Configuration config, java.util.Properties props) throws XPathException
Obtain a collation with a given set of properties. The set of properties is extensible and variable across platforms. Common properties with example values include lang=ed-GB, strength=primary, case-order=upper-first, ignore-modifiers=yes, alphanumeric=yes. Properties that are not supported are generally ignored; however some errors, such as failing to load a requested class, are fatal.- Parameters:
config- the configuration objectprops- the desired properties of the collation- Returns:
- a collation with these properties
- Throws:
XPathException- if a fatal error occurs
-
canReturnCollationKeys
boolean canReturnCollationKeys(java.util.Comparator collation)
Given a collation, determine whether it is capable of returning collation keys. The essential property of collation keys is that if two values are equal under the collation, then the collation keys are equal under the equals() method.- Parameters:
collation- the collation being examined, provided as a Comparator- Returns:
- true if this collation can supply collation keys
-
getCollationKey
java.lang.Object getCollationKey(java.util.Comparator collation, java.lang.String value)Given a collation, get a collation key. The essential property of collation keys is that if two values are equal under the collation, then the collation keys are equal under the equals() method.- Returns:
- a representation of the collation key, such that two collation keys are equal() if and only if the string values they represent are equal under the specified collation.
- Throws:
java.lang.ClassCastException- if the collation is not one that is capable of supplying collation keys (this should have been checked in advance)
-
addFunctionLibraries
void addFunctionLibraries(FunctionLibraryList list, Configuration config)
Add platform-specific function libraries to the function library list
-
getExternalObjectType
SchemaType getExternalObjectType(java.lang.String uri, java.lang.String localName)
-
-