public class RetainedStaticContext extends java.lang.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(java.lang.String prefix,
java.lang.String uri)
Add a namespace binding to the static namespace context ("in-scope namespaces")
|
boolean |
declaresSameNamespaces(RetainedStaticContext other)
Test whether this static context declares the same namespaces as another static context
|
boolean |
equals(java.lang.Object other) |
Configuration |
getConfiguration()
Get the Configuration
|
DecimalFormatManager |
getDecimalFormatManager()
Get the decimal format manager
|
java.lang.String |
getDefaultCollationName()
Get the name of the default collation for this static context
|
java.lang.String |
getDefaultElementNamespace()
Get the default namespace for elements and types
|
java.lang.String |
getDefaultFunctionNamespace()
Get the default namespace for functions
|
PackageData |
getPackageData()
Get information about the package (unit of compilation)
|
java.net.URI |
getStaticBaseUri()
Get the static base URI as a URI.
|
java.lang.String |
getStaticBaseUriString()
Get the static base URI as a string.
|
java.lang.String |
getURIForPrefix(java.lang.String prefix,
boolean useDefault)
Get the namespace URI corresponding to a given prefix.
|
int |
hashCode() |
boolean |
isBackwardsCompatibility() |
java.util.Iterator<java.lang.String> |
iteratePrefixes()
Get an iterator over all the prefixes declared in this namespace context.
|
void |
setBackwardsCompatibility(boolean backwardsCompatibility) |
void |
setDecimalFormatManager(DecimalFormatManager decimalFormatManager)
Set the decimal format manager
|
void |
setDefaultCollationName(java.lang.String defaultCollationName)
Set the name of the default collation for this static context
|
void |
setDefaultElementNamespace(java.lang.String ns)
Set the default namespace for elements and type
|
void |
setDefaultFunctionNamespace(java.lang.String defaultFunctionNamespace)
Set the default namespace for functions
|
void |
setNamespaces(java.util.Map<java.lang.String,java.lang.String> namespaces) |
void |
setPackageData(PackageData packageData)
Set information about the package (unit of compilation
|
void |
setStaticBaseUriString(java.lang.String baseUri)
Set the static base URI as a string
|
public RetainedStaticContext(Configuration config)
public RetainedStaticContext(StaticContext sc)
public Configuration getConfiguration()
public void setPackageData(PackageData packageData)
packageData
- the package datapublic PackageData getPackageData()
public void setStaticBaseUriString(java.lang.String baseUri)
baseUri
- the base URI as a stringpublic java.net.URI getStaticBaseUri() throws XPathException
XPathException
- if the static base URI is not a valid URI.public java.lang.String getStaticBaseUriString()
public java.lang.String getDefaultCollationName()
public void setDefaultCollationName(java.lang.String defaultCollationName)
defaultCollationName
- the default collation URIpublic java.lang.String getDefaultFunctionNamespace()
public void setDefaultFunctionNamespace(java.lang.String defaultFunctionNamespace)
defaultFunctionNamespace
- the default namespace for functionspublic java.lang.String getDefaultElementNamespace()
public void setDefaultElementNamespace(java.lang.String ns)
ns
- the default namespace for elements and types.public DecimalFormatManager getDecimalFormatManager()
public void setDecimalFormatManager(DecimalFormatManager decimalFormatManager)
decimalFormatManager
- the decimal format managerpublic boolean isBackwardsCompatibility()
public void setBackwardsCompatibility(boolean backwardsCompatibility)
public void declareNamespace(java.lang.String prefix, java.lang.String uri)
prefix
- the namespace prefixuri
- the namespace URIpublic java.lang.String getURIForPrefix(java.lang.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 java.util.Iterator<java.lang.String> iteratePrefixes()
iteratePrefixes
in interface NamespaceResolver
public boolean declaresSameNamespaces(RetainedStaticContext other)
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public void setNamespaces(java.util.Map<java.lang.String,java.lang.String> namespaces)
Copyright (c) 2004-2020 Saxonica Limited. All rights reserved.