net.sf.saxon.functions

## Class StaticContextForSystemFunctions

- java.lang.Object
- - net.sf.saxon.functions.StaticContextForSystemFunctions

-     public class StaticContextForSystemFunctions
      extends Object

  An implementation of the StaticContext interface, holding those parts of the static context that can be used by system functions. This is especially relevant when system functions are executed dynamically via function-lookup().

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `StaticContextForSystemFunctions(Executable exec)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getBaseURI()` Get the Base URI, for resolving any relative URI's used in the expression.
    `StringCollator` | `getCollation(String name)` Get a named collation.
    `CollationMap` | `getCollationMap()` Get the collation map in use
    `Configuration` | `getConfiguration()` Get the system configuration
    `DecimalFormatManager` | `getDecimalFormatManager()` Get a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.
    `String` | `getDefaultCollationName()` Get the name of the default collation.
    `String` | `getDefaultElementNamespace()` Get the default namespace URI for elements and types Return NamespaceConstant.NULL (that is, the zero-length string) for the non-namespace
    `String` | `getDefaultFunctionNamespace()` Get the default function namespace.
    `FunctionLibrary` | `getFunctionLibrary()` Get the function library containing all the in-scope functions available in this static context.
    `int` | `getLineNumber()` Get the line number of the expression within that container.
    `LocationMap` | `getLocationMap()`
    `NamePool` | `getNamePool()` Get the NamePool used for compiling expressions
    `ItemType` | `getRequiredContextItemType()` Get the required type of the context item.
    `String` | `getSystemId()` Get the system ID of the container of the expression.
    `DecimalValue` | `getXPathLanguageLevel()` Get the XPath language level supported, as a string.
    `boolean` | `isAllowedBuiltInType(BuiltInAtomicType type)` Determine whether a built-in type is available in this context.
    `boolean` | `isInBackwardsCompatibleMode()` Determine whether Backwards Compatible Mode is used
    `boolean` | `isSchemaAware()` Ask whether this static context is schema-aware
    `void` | `issueWarning(String s, SourceLocator locator)` Issue a compile-time warning.
    `XPathContext` | `makeEarlyEvaluationContext()` Construct a dynamic context for early evaluation of constant subexpressions
    `void` | `setBaseURI(String baseURI)` Set the base URI in the static context
    `void` | `setDecimalFormatManager(DecimalFormatManager manager)` Set the DecimalFormatManager used to resolve the names of decimal formats used in calls to the format-number() function.
    `void` | `setDefaultElementNamespace(String uri)` Set the default namespace for elements and types

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### StaticContextForSystemFunctions

          public StaticContextForSystemFunctions(Executable exec)

  - ### Method Detail

    - #### getConfiguration

          public Configuration getConfiguration()

      Get the system configuration

    - #### getCollationMap

          public CollationMap getCollationMap()

      Get the collation map in use
      Returns:
        the collation map

    - #### isSchemaAware

          public boolean isSchemaAware()

      Ask whether this static context is schema-aware
      Returns:
        true if this context is schema-aware

    - #### makeEarlyEvaluationContext

          public XPathContext makeEarlyEvaluationContext()

      Construct a dynamic context for early evaluation of constant subexpressions

    - #### getLocationMap

          public LocationMap getLocationMap()

    - #### setBaseURI

          public void setBaseURI(String baseURI)

      Set the base URI in the static context
      Parameters:
        `baseURI` - the base URI of the expression

    - #### getBaseURI

          public String getBaseURI()

      Get the Base URI, for resolving any relative URI's used in the expression. Used by the document() function, resolve-uri(), etc.
      Returns:
        "" if no base URI has been set

    - #### getFunctionLibrary

          public FunctionLibrary getFunctionLibrary()

      Get the function library containing all the in-scope functions available in this static context. This method is called by the XPath parser when binding a function call in the XPath expression to an implementation of the function.

    - #### getCollation

          public StringCollator getCollation(String name)

      Get a named collation.
      Returns:
        the collation identified by the given name, as set previously using declareCollation. Return null if no collation with this name is found.

    - #### getDefaultCollationName

          public String getDefaultCollationName()

      Get the name of the default collation.
      Returns:
        the name of the default collation; or the name of the codepoint collation if no default collation has been defined

    - #### getNamePool

          public NamePool getNamePool()

      Get the NamePool used for compiling expressions

    - #### issueWarning

          public void issueWarning(String s,
                          SourceLocator locator)

      Issue a compile-time warning. This method is used during XPath expression compilation to output warning conditions. The default implementation writes the message to the error listener registered with the Configuration.

    - #### getSystemId

          public String getSystemId()

      Get the system ID of the container of the expression. Used to construct error messages.
      Returns:
        "" always

    - #### getLineNumber

          public int getLineNumber()

      Get the line number of the expression within that container. Used to construct error messages.
      Returns:
        -1 always

    - #### getDefaultElementNamespace

          public String getDefaultElementNamespace()

      Get the default namespace URI for elements and types Return NamespaceConstant.NULL (that is, the zero-length string) for the non-namespace
      Returns:
        the default namespace for elements and type

    - #### setDefaultElementNamespace

          public void setDefaultElementNamespace(String uri)

      Set the default namespace for elements and types
      Parameters:
        `uri` - the namespace to be used for unprefixed element and type names. The value "" (or NamespaceConstant.NULL) represents the non-namespace

    - #### getDefaultFunctionNamespace

          public String getDefaultFunctionNamespace()

      Get the default function namespace. The value "" (or NamespaceConstant.NULL) represents the non-namespace
      Returns:
        the default namesapce for functions

    - #### getXPathLanguageLevel

          public DecimalValue getXPathLanguageLevel()

      Get the XPath language level supported, as a string. The current levels supported are "2.0", and "3.0". The default is "2.0". If running XQuery 1.0, the value is "2.0"; if running XQuery 3.0, it is "3.0".
      Returns:
        the XPath language level
      Since:
        9.3

    - #### isInBackwardsCompatibleMode

          public boolean isInBackwardsCompatibleMode()

      Determine whether Backwards Compatible Mode is used
      Returns:
        true if XPath 1.0 compatibility mode is to be set to true; otherwise false

    - #### isAllowedBuiltInType

          public boolean isAllowedBuiltInType(BuiltInAtomicType type)

      Determine whether a built-in type is available in this context. This method caters for differences between host languages as to which set of types are built in.
      Parameters:
        `type` - the supposedly built-in type. This will always be a type in the XS namespace.
      Returns:
        true if this type can be used in this static context

    - #### setDecimalFormatManager

          public void setDecimalFormatManager(DecimalFormatManager manager)

      Set the DecimalFormatManager used to resolve the names of decimal formats used in calls to the format-number() function.
      Parameters:
        `manager` - the decimal format manager for this static context, or null if no named decimal formats are available in this environment.

    - #### getRequiredContextItemType

          public ItemType getRequiredContextItemType()

      Get the required type of the context item. If no type has been explicitly declared for the context item, an instance of AnyItemType (representing the type item()) is returned.
      Returns:
        the required type of the context item
      Since:
        9.3

    - #### getDecimalFormatManager

          public DecimalFormatManager getDecimalFormatManager()

      Get a DecimalFormatManager to resolve the names of decimal formats used in calls to the format-number() function.
      Returns:
        the decimal format manager for this static context; a newly created empty DecimalFormatManager if none has been supplied
      Since:
        9.2

Copyright (c) 2004-2013 Saxonica Limited. All rights reserved.