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-21, BSD License, Christian Gruen
  • Field Details

    • 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 Details

    • StaticContext

      public StaticContext(QueryContext qc)
      Constructor.
      Parameters:
      qc - query context
  • Method Details

    • 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 or null.
      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 path
      uri - module namespace (can be null, 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
    • toString

      public String toString()
      Overrides:
      toString in class Object