Package org.basex.query
Class StaticContext
- java.lang.Object
-
- org.basex.query.StaticContext
-
public final class StaticContext extends Object
This class contains the static context of an expression.- Author:
- BaseX Team 2005-22, BSD License, Christian Gruen
-
-
Field Summary
Fields Modifier and Type Field Description Collation
collation
Default collation (default collection (QueryText.COLLATION_URI
):null
).TokenObjMap<DecFormatter>
decFormats
Decimal formats.byte[]
elemNS
Default element/type namespace.byte[]
funcNS
Default function namespace.boolean
inheritNS
Copy-namespaces mode: (no-)inherit.boolean
mixUpdates
Mix updates flag.QNm
module
Name of module (not assigned for main module).NSContext
ns
Static and dynamic namespaces.boolean
ordered
Ordering mode.boolean
orderGreatest
Default order for empty sequences.boolean
preserveNS
Copy-namespaces mode: (no-)preserve.boolean
spaces
Boundary-space policy.boolean
strip
Construction mode.boolean
withdb
Look up documents in databases.
-
Constructor Summary
Constructors Constructor Description StaticContext(QueryContext qc)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description IO
baseIO()
Returns an IO representation of the static base URI ornull
.Uri
baseURI()
Returns the static base URI.void
baseURI(String uri)
Sets the static base URI.DecFormatter
decFormat(byte[] id)
Returns a decimal format.IO
resolve(String path)
Resolves the specified path against the base URI.IO
resolve(String path, String uri)
Returns an IO reference for the specified path.String
toString()
-
-
-
Field Detail
-
decFormats
public final TokenObjMap<DecFormatter> decFormats
Decimal formats.
-
ns
public final NSContext ns
Static and dynamic namespaces.
-
mixUpdates
public final boolean mixUpdates
Mix updates flag.
-
withdb
public final boolean withdb
Look up documents in databases.
-
collation
public Collation collation
Default collation (default collection (QueryText.COLLATION_URI
):null
).
-
elemNS
public byte[] elemNS
Default element/type namespace.
-
funcNS
public byte[] funcNS
Default function namespace.
-
module
public QNm module
Name of module (not assigned for main module).
-
strip
public boolean strip
Construction mode.
-
ordered
public boolean ordered
Ordering mode.
-
orderGreatest
public boolean orderGreatest
Default order for empty sequences.
-
spaces
public boolean spaces
Boundary-space policy.
-
preserveNS
public boolean preserveNS
Copy-namespaces mode: (no-)preserve.
-
inheritNS
public boolean inheritNS
Copy-namespaces mode: (no-)inherit.
-
-
Constructor Detail
-
StaticContext
public StaticContext(QueryContext qc)
Constructor.- Parameters:
qc
- query context
-
-
Method Detail
-
baseURI
public Uri baseURI()
Returns the static base URI.- Returns:
- base URI
-
baseURI
public void baseURI(String uri)
Sets the static base URI.- Parameters:
uri
- URI to be set: an empty URI will be ignored,null
invalidates the URI
-
baseIO
public IO baseIO()
Returns an IO representation of the static base URI ornull
.- Returns:
- IO reference (can be
null
)
-
resolve
public IO resolve(String path)
Resolves the specified path against the base URI.- Parameters:
path
- to be resolved- Returns:
- resulting path
-
resolve
public IO resolve(String path, String uri)
Returns an IO reference for the specified path. If a base URI exists, it is merged with the path.- Parameters:
path
- file pathuri
- module namespace (can benull
, only relevant for custom resolver)- Returns:
- io reference
-
decFormat
public DecFormatter decFormat(byte[] id) throws QueryException
Returns a decimal format.- Parameters:
id
- format id- Returns:
- decimal format or
null
- Throws:
QueryException
- query exception
-
-