public class RetainedStaticContext extends Object implements NamespaceResolver
From 9.6, the retained static context is available to every expression in the expression tree (previously, expressions only retained that part of the static context needed by the particular expression). For economy, a new RetainedStaticContext object is only created when the context changes: which is fairly rare (for example, it never happens within an XPath expression).
Constructor and Description |
---|
RetainedStaticContext(Configuration config) |
RetainedStaticContext(StaticContext sc) |
Modifier and Type | Method and Description |
---|---|
void |
declareNamespace(String prefix,
String uri)
Add a namespace binding to the static namespace context ("in-scope namespaces")
|
boolean |
equals(Object other) |
Configuration |
getConfiguration()
Get the Configuration
|
DecimalFormatManager |
getDecimalFormatManager()
Get the decimal format manager
|
String |
getDefaultCollationName()
Get the name of the default collation for this static context
|
String |
getDefaultElementNamespace()
Get the default namespace for elements and types
|
String |
getDefaultFunctionNamespace()
Get the default namespace for functions
|
PackageData |
getPackageData()
Get information about the package (unit of compilation)
|
URI |
getStaticBaseUri()
Get the static base URI as a URI.
|
String |
getStaticBaseUriString()
Get the static base URI as a string.
|
String |
getURIForPrefix(String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix.
|
int |
getXPathVersion()
Get the XPath version in use.
|
int |
hashCode() |
boolean |
isBackwardsCompatibility() |
Iterator<String> |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context.
|
boolean |
JAXPStaticContextCheck(StaticContext sc) |
void |
setBackwardsCompatibility(boolean backwardsCompatibility) |
void |
setDecimalFormatManager(DecimalFormatManager decimalFormatManager)
Set the decimal format manager
|
void |
setDefaultCollationName(String defaultCollationName)
Set the name of the default collation for this static context
|
void |
setDefaultElementNamespace(String ns)
Set the default namespace for elements and type
|
void |
setDefaultFunctionNamespace(String defaultFunctionNamespace)
Set the default namespace for functions
|
void |
setNamespacesFromJAXP(JAXPXPathStaticContext sc)
Create namespace information from the JAXP XPath static context.
|
void |
setPackageData(PackageData packageData)
Set information about the package (unit of compilation
|
void |
setStaticBaseUriString(String baseUri)
Set the static base URI as a string
|
void |
setXPathVersion(int version)
Set the XPath version in use.
|
public RetainedStaticContext(Configuration config)
public RetainedStaticContext(StaticContext sc)
public boolean JAXPStaticContextCheck(StaticContext sc)
public void setNamespacesFromJAXP(JAXPXPathStaticContext sc)
sc
- JAXP static contextpublic Configuration getConfiguration()
public void setPackageData(PackageData packageData)
packageData
- the package datapublic PackageData getPackageData()
public void setStaticBaseUriString(String baseUri)
baseUri
- the base URI as a stringpublic URI getStaticBaseUri() throws XPathException
XPathException
- if the static base URI is not a valid URI.public String getStaticBaseUriString()
public String getDefaultCollationName()
public void setDefaultCollationName(String defaultCollationName)
defaultCollationName
- the default collation URIpublic String getDefaultFunctionNamespace()
public void setDefaultFunctionNamespace(String defaultFunctionNamespace)
defaultFunctionNamespace
- the default namespace for functionspublic String getDefaultElementNamespace()
public void setDefaultElementNamespace(String ns)
ns
- the default namespace for elements and types.public DecimalFormatManager getDecimalFormatManager()
public void setDecimalFormatManager(DecimalFormatManager decimalFormatManager)
decimalFormatManager
- the decimal format managerpublic int getXPathVersion()
public void setXPathVersion(int version)
version
- the XPath version, times ten. For example return 31 to indicate XPath 3.1.public boolean isBackwardsCompatibility()
public void setBackwardsCompatibility(boolean backwardsCompatibility)
public void declareNamespace(String prefix, String uri)
prefix
- the namespace prefixuri
- the namespace URIpublic String getURIForPrefix(String prefix, boolean useDefault)
getURIForPrefix
in interface NamespaceResolver
prefix
- the namespace prefix. May be the zero-length string, indicating
that there is no prefix. This indicates either the default namespace or the
null namespace, depending on the value of useDefault.useDefault
- true if the default namespace is to be used when the
prefix is "". If set to false, and the prefix is "", then the
value "" is returned regardless of the default namespace in force.
The "default namespace" here means the one bound to the prefix "".public Iterator<String> iteratePrefixes()
iteratePrefixes
in interface NamespaceResolver
Copyright (c) 2004-2014 Saxonica Limited. All rights reserved.