|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.sf.saxon.java.JavaPlatform
public class JavaPlatform
Implementation of the Platform class containing methods specific to the Java platform (as distinct from .NET). This is a singleton class with no instance data.
Method Summary | |
---|---|
void |
addFunctionLibraries(FunctionLibraryList list,
Configuration config)
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,
int xmlVersion,
int syntax,
CharSequence flags)
Create a compiled regular expression |
void |
declareJavaClass(FunctionLibrary library,
String uri,
Class theClass)
Register a namespace-to-Java-class mapping declared using saxon:script in an XSLT stylesheet |
Object |
getCollationKey(NamedCollation 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 |
static JavaPlatform |
getInstance()
|
Source |
getParserSource(Configuration config,
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 |
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 |
URI |
makeAbsolute(String relativeURI,
String base)
Construct an absolute URI from a relative URI and a base URI. |
StringCollator |
makeCollation(Configuration config,
Properties props,
String uri)
Obtain a collation with a given set of properties. |
void |
makeExtensionLibrary(Configuration config)
Make the default extension function factory appropriate to the platform |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static JavaPlatform getInstance()
public void initialize(Configuration config)
initialize
in interface Platform
config
- the Saxon Configurationpublic boolean isJava()
isJava
in interface Platform
public boolean isDotNet()
isDotNet
in interface Platform
public URI makeAbsolute(String relativeURI, String base) throws URISyntaxException
new URL(baseURL, relativeURL)
.
Spaces in either URI are converted to %20
If no base URI is available, and the relative URI is not an absolute URI, then the current directory is used as a base URI.
makeAbsolute
in interface Platform
relativeURI
- the relative URI. Null is permitted provided that the base URI is an absolute URIbase
- the base URI
URISyntaxException
- if either of the strings is not a valid URI or
if the resolution failspublic String getPlatformVersion()
getPlatformVersion
in interface Platform
public String getPlatformSuffix()
getPlatformSuffix
in interface Platform
public Source getParserSource(Configuration config, StreamSource input, int validation, boolean dtdValidation, int stripspace)
getParserSource
in interface Platform
config
- input
- the supplied StreamSourcevalidation
- dtdValidation
- stripspace
-
public RegularExpression compileRegularExpression(CharSequence regex, int xmlVersion, int syntax, CharSequence flags) throws XPathException
compileRegularExpression
in interface Platform
regex
- the source text of the regular expression, in XML Schema or XPath syntaxxmlVersion
- set to integer 10 for XML 1.0, 11 for XML 1.1syntax
- flags
- the flags argument as supplied to functions such as fn:matches(), in string form @throws XPathException if the syntax of the regular expression or flags is incorrect @return the compiled regular expression
XPathException
public StringCollator makeCollation(Configuration config, Properties props, String uri) throws XPathException
makeCollation
in interface Platform
config
- the configuration objectprops
- the desired properties of the collationuri
-
XPathException
- if a fatal error occurspublic boolean canReturnCollationKeys(StringCollator collation)
canReturnCollationKeys
in interface Platform
collation
- the collation, provided as a Comparator
public Object getCollationKey(NamedCollation namedCollation, String value)
getCollationKey
in interface Platform
namedCollation
- the collation in usevalue
- the string whose collation key is required
ClassCastException
- if the collation is not one that is capable of supplying
collation keys (this should have been checked in advance)public void makeExtensionLibrary(Configuration config)
makeExtensionLibrary
in interface Platform
config
- the Saxon Configurationpublic void addFunctionLibraries(FunctionLibraryList list, Configuration config)
Configuration.setExtensionBinder(String, net.sf.saxon.functions.FunctionLibrary)
addFunctionLibraries
in interface Platform
list
- the function library list that is to be extendedconfig
- the Configurationpublic void declareJavaClass(FunctionLibrary library, String uri, Class theClass)
declareJavaClass
in interface Platform
library
- the library to contain the function, which must be a JavaExtensionLibraryuri
- the namespace of the function nametheClass
- the Java class that implements this namespacepublic 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 type
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |