org.basex.query
Class StaticContext

java.lang.Object
  extended by org.basex.query.StaticContext

public final class StaticContext
extends java.lang.Object

This class contains the static context of an expression.

Author:
BaseX Team 2005-12, BSD License, Christian Gruen

Field Summary
 Collation collation
          Default collation.
 TokenObjMap<DecFormatter> decFormats
          Decimal formats.
 SeqType initType
          Context item static type.
 NSContext ns
          Static and dynamic namespaces.
 byte[] nsElem
          Default element/type namespace.
 byte[] nsFunc
          Default function namespace.
 boolean nsInherit
          Copy-namespaces mode: (no-)inherit.
 boolean nsPreserve
          Copy-namespaces mode: (no-)preserve.
 boolean ordered
          Ordering mode.
 boolean orderGreatest
          Default order for empty sequences.
 boolean spaces
          Boundary-space policy.
 boolean strip
          Construction mode.
 
Constructor Summary
StaticContext(boolean xq30)
          Constructor setting the XQuery version.
 
Method Summary
 IO baseIO()
          Returns an IO representation of the static base URI, or null.
 Uri baseURI()
          Returns the static base URI.
 void baseURI(java.lang.String uri)
          Sets the static base URI.
 IO io(java.lang.String path)
          Returns an IO reference for the specified filename.
 void namespace(java.lang.String prefix, java.lang.String uri)
          Declares a namespace.
 java.lang.String toString()
           
 boolean xquery3()
          Checks if XQuery 3.0 features are allowed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

decFormats

public final TokenObjMap<DecFormatter> decFormats
Decimal formats.


ns

public final NSContext ns
Static and dynamic namespaces.


collation

public Collation collation
Default collation.


nsElem

public byte[] nsElem
Default element/type namespace.


nsFunc

public byte[] nsFunc
Default function namespace.


initType

public SeqType initType
Context item static type.


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.


nsPreserve

public boolean nsPreserve
Copy-namespaces mode: (no-)preserve.


nsInherit

public boolean nsInherit
Copy-namespaces mode: (no-)inherit.

Constructor Detail

StaticContext

public StaticContext(boolean xq30)
Constructor setting the XQuery version.

Parameters:
xq30 - XQuery 3.0 flag
Method Detail

namespace

public void namespace(java.lang.String prefix,
                      java.lang.String uri)
               throws QueryException
Declares a namespace. A namespace is undeclared if the specified URI is an empty string. The default element namespaces is set if the specified prefix is empty.

Parameters:
prefix - namespace prefix
uri - namespace URI
Throws:
QueryException - query exception

baseIO

public IO baseIO()
Returns an IO representation of the static base URI, or null.

Returns:
IO reference

io

public IO io(java.lang.String path)
Returns an IO reference for the specified filename. If a base URI exists, it is merged with the specified filename. Otherwise, a plain reference is returned.

Parameters:
path - file path
Returns:
io reference

baseURI

public Uri baseURI()
Returns the static base URI.

Returns:
base URI

baseURI

public void baseURI(java.lang.String uri)
Sets the static base URI.

Parameters:
uri - uri to be set

xquery3

public boolean xquery3()
Checks if XQuery 3.0 features are allowed.

Returns:
true if XQuery 3.0 is allowed, false otherwise

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object