net.sf.saxon.expr.flwor

## Class ClauseInfo

- java.lang.Object
- - net.sf.saxon.expr.flwor.ClauseInfo

- All Implemented Interfaces:
    SourceLocator, LocationProvider, SaxonLocator, InstructionInfo, Locator

      public class ClauseInfo
      extends Object
      implements InstructionInfo

  A "trace" clause in a FLWOR expression, added by a TraceCodeInjector

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ClauseInfo(Clause clause, Container container)`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `Clause` | `getClause()` Get the clause being traced
    `int` | `getColumnNumber()` Return the column number where the current document event ends.
    `int` | `getColumnNumber(long locationId)` Get the column number within the document, entity, or module containing a particular location
    `int` | `getConstructType()` Get the type of construct.
    `int` | `getLineNumber()` Get the line number of the instruction in the source stylesheet module.
    `int` | `getLineNumber(long locationId)` Get the line number within the document, entity or module containing a particular location
    `NamespaceResolver` | `getNamespaceResolver()` Get the namespace bindings from the static context of the clause
    `StructuredQName` | `getObjectName()` Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc.
    `Iterator<String>` | `getProperties()` Get an iterator over all the properties available.
    `Object` | `getProperty(String name)` Get the value of a particular property of the instruction.
    `String` | `getPublicId()` Return the public identifier for the current document event.
    `String` | `getSystemId()` Get the system identifier (URI) of the source stylesheet or query module containing the instruction.
    `String` | `getSystemId(long locationId)` Get the URI of the document, entity, or module containing a particular location
    `void` | `setNamespaceResolver(NamespaceResolver nsResolver)` Set the namespace bindings from the static context of the clause

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

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

- - ### Constructor Detail

    - #### ClauseInfo

          public ClauseInfo(Clause clause,
                    Container container)

  - ### Method Detail

    - #### getClause

          public Clause getClause()

      Get the clause being traced
      Returns:
        the clause in the FLWOR expression to which this ClauseInfo relates

    - #### getConstructType

          public int getConstructType()

      Get the type of construct. This will either be the fingerprint of a standard XSLT instruction name (values in `StandardNames`: all less than 1024) or it will be a constant in class `Location`.
      Specified by:
        `getConstructType` in interface `InstructionInfo`
      Returns:
        an integer identifying the kind of construct

    - #### getObjectName

          public StructuredQName getObjectName()

      Get a name identifying the object of the expression, for example a function name, template name, variable name, key name, element name, etc. This is used only where the name is known statically.
      Specified by:
        `getObjectName` in interface `InstructionInfo`
      Returns:
        the QName of the object declared or manipulated by this instruction or expression

    - #### getNamespaceResolver

          public NamespaceResolver getNamespaceResolver()

      Get the namespace bindings from the static context of the clause
      Returns:
        a namespace resolver that reflects the in scope namespaces of the clause

    - #### setNamespaceResolver

          public void setNamespaceResolver(NamespaceResolver nsResolver)

      Set the namespace bindings from the static context of the clause
      Parameters:
        `nsResolver` - a namespace resolver that reflects the in scope namespaces of the clause

    - #### getSystemId

          public String getSystemId()

      Get the system identifier (URI) of the source stylesheet or query module containing the instruction. This will generally be an absolute URI. If the system identifier is not known, the method may return null. In some cases, for example where XML external entities are used, the correct system identifier is not always retained.
      Specified by:
        `getSystemId` in interface `SourceLocator`
      Specified by:
        `getSystemId` in interface `InstructionInfo`
      Specified by:
        `getSystemId` in interface `Locator`
      Returns:
        the URI of the containing module

    - #### getLineNumber

          public int getLineNumber()

      Get the line number of the instruction in the source stylesheet module. If this is not known, or if the instruction is an artificial one that does not relate to anything in the source code, the value returned may be -1.
      Specified by:
        `getLineNumber` in interface `SourceLocator`
      Specified by:
        `getLineNumber` in interface `InstructionInfo`
      Specified by:
        `getLineNumber` in interface `Locator`
      Returns:
        the line number of the expression within the containing module

    - #### getProperty

          public Object getProperty(String name)

      Get the value of a particular property of the instruction. Properties of XSLT instructions are generally known by the name of the stylesheet attribute that defines them.
      Specified by:
        `getProperty` in interface `InstructionInfo`
      Parameters:
        `name` - The name of the required property
      Returns:
        The value of the requested property, or null if the property is not available

    - #### getProperties

          public Iterator<String> getProperties()

      Get an iterator over all the properties available. The values returned by the iterator will be of type String, and each string can be supplied as input to the getProperty() method to retrieve the value of the property. The iterator may return properties whose value is null.
      Specified by:
        `getProperties` in interface `InstructionInfo`
      Returns:
        an iterator over the properties.

    - #### getSystemId

          public String getSystemId(long locationId)

      Get the URI of the document, entity, or module containing a particular location
      Specified by:
        `getSystemId` in interface `LocationProvider`
      Parameters:
        `locationId` - identifier of the location in question (as passed down the Receiver pipeline)
      Returns:
        the URI of the document, XML entity or module. For a SourceLocationProvider this will be the URI of the document or entity (the URI that would be the base URI if there were no xml:base attributes). In other cases it may identify the query or stylesheet module currently being executed.

    - #### getLineNumber

          public int getLineNumber(long locationId)

      Get the line number within the document, entity or module containing a particular location
      Specified by:
        `getLineNumber` in interface `LocationProvider`
      Parameters:
        `locationId` - identifier of the location in question (as passed down the Receiver pipeline)
      Returns:
        the line number within the document, entity or module, or -1 if no information is available.

    - #### getColumnNumber

          public int getColumnNumber(long locationId)

      Get the column number within the document, entity, or module containing a particular location
      Specified by:
        `getColumnNumber` in interface `LocationProvider`
      Parameters:
        `locationId` - identifier of the location in question (as passed down the Receiver pipeline)
      Returns:
        the column number within the document, entity, or module, or -1 if this is not available

    - #### getPublicId

          public String getPublicId()

      Return the public identifier for the current document event.

      The return value is the public identifier of the document entity or of the external parsed entity in which the markup triggering the event appears.

      Specified by:
        `getPublicId` in interface `SourceLocator`
      Specified by:
        `getPublicId` in interface `Locator`
      Returns:
        A string containing the public identifier, or null if none is available.
      See Also:
        `getSystemId()`

    - #### getColumnNumber

          public int getColumnNumber()

      Return the column number where the current document event ends. This is one-based number of Java `char` values since the last line end.

      Warning: The return value from the method is intended only as an approximation for the sake of diagnostics; it is not intended to provide sufficient information to edit the character content of the original XML document. For example, when lines contain combining character sequences, wide characters, surrogate pairs, or bi-directional text, the value may not correspond to the column in a text editor's display.

      The return value is an approximation of the column number in the document entity or external parsed entity where the markup triggering the event appears.

      If possible, the SAX driver should provide the line position of the first character after the text associated with the document event. The first column in each line is column 1.

      Specified by:
        `getColumnNumber` in interface `SourceLocator`
      Specified by:
        `getColumnNumber` in interface `Locator`
      Returns:
        The column number, or -1 if none is available.
      See Also:
        `getLineNumber()`

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