XmlTextInfo (API documentation of hlt.language packages)
Date: 2013-01-30

hlt.language.syntax

## Class XmlTextInfo

- java.lang.Object
- - hlt.language.syntax.XmlTextInfoArg
  - - hlt.language.syntax.XmlTextInfo

-     public class XmlTextInfo
      extends XmlTextInfoArg

  The class `XmlTextInfo` packages information parsed from an XML serialization annotation, which may be of one of the following three possible kinds:
  - a literal (unquoted, single-quoted, or double-quoted) text string; or,
  - a path expression (of type an `XmlTreePath`) of the form `c[x1...xn]/a`, where `c` and the `xi`'s are positive integers, `a` is a symbol, and where both `[x1...xn]` and `/a`, are optional; or,
  - a special form of the form `$VALUE` or `$TEXT(...)`.
  Thus, its structure extends that of an `XmlTextInfoArg`, which explains why it is a subclass of it.

  Basically, this contains all the information needed to manufacture a piece of text out of the partial CST and XML trees at parse time that will be the actual value of text. It can have one of five forms:

  1. a literal (unquoted, or posssibly single- or double-quote) string;
  2. a reference to an XML tree node's
     1. text contents, in the form `c` or `c[x1 ... xn]`; or
     2. attribute's value (in the form `c/a` or `c[x1 ... xn]/a`);
  3. the special form
     1. `$VALUE`; or,
     2. `$TEXT(...)`, where each argument is either:
        1. a literal (unquoted, or posssibly single- or double-quote) string; or,
        2. a reference to an XML tree node (in the form `c` or `c[x1 ... xn]`); or,
        3. a reference to an XML tree node's attribute's value (in the form `c/a` or `c[x1 ... xn]/a`).
  According to which the attribute value computed in each case will be, respectively:
  - Case 1: the literal string;
  - Case 2.a: the text content of the referenced XML tree node;
  - Case 2.b: the text value of the referenced XML tree node's attribute;
  - Case 3.a: the value parsed for the corresponding terminal;
  - Case 3.b: the concatenation of the text strings corresponding to the parse-time values denoted by each argument.
  Version:
    Last modified on Fri Apr 13 20:22:30 2012 by hak
  Author:
    Hassan Aït-Kaci
  Copyright:
    © by the author

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlTextInfo()` Constructs an empty `XmlTextInfoArg`.
    `XmlTextInfo(int child, int[] path, java.lang.String attribute)` Constructs an `XmlTextInfo` with specified child position, (possibly null) xml path, and a (possibly null) attribute name.
    `XmlTextInfo(int child, IntArrayList path, boolean isTerminal, ArrayList textInfo, java.lang.String attribute)` Constructs an `XmlTextInfo` with specified child position,
    `XmlTextInfo(int child, IntArrayList path, java.lang.String attribute)` Constructs an `XmlTextInfo` with specified child position, (possibly null) xml path, and a (possibly null) attribute name.
    `XmlTextInfo(java.lang.String attribute)` Constructs an `XmlTextInfo` with specified attribute name.
    `XmlTextInfo(XmlSpecialForm form)` Constructs an `XmlTextInfo` with specified special form.
    `XmlTextInfo(XmlTreePath xmlTreePath)` Constructs an `XmlTextInfo` with specified `XmlTreePath`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `isSpecialForm()` `isSpecialForm()` returns `true` whenever this is a special form.
    `boolean` | `isXmlTreePath()` `isXmlTreePath()` returns `true` whenever this is an XML tree path.
    `XmlSpecialForm` | `specialForm()` Returns this `XmlTextInfo`'s `_specialForm`.
    `java.lang.String` | `toString()` Returns a `String` form of this `XmlTextInfo`.

    - ### Methods inherited from class hlt.language.syntax.XmlTextInfoArg

      `attribute, child, hasAttribute, hasChild, hasPath, hasXmlTreePath, isLiteral, makeTextForm, path, setChild, setPath, setText, setXmlTreePath, text, xmlTreePath`

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

      `equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

- - ### Constructor Detail

    - #### XmlTextInfo

          public XmlTextInfo()

      Constructs an empty `XmlTextInfoArg`.

    - #### XmlTextInfo

          public XmlTextInfo(XmlTreePath xmlTreePath)

      Constructs an `XmlTextInfo` with specified `XmlTreePath`.

    - #### XmlTextInfo

          public XmlTextInfo(int child,
                     int[] path,
                     java.lang.String attribute)

      Constructs an `XmlTextInfo` with specified child position, (possibly null) xml path, and a (possibly null) attribute name.

    - #### XmlTextInfo

          public XmlTextInfo(int child,
                     IntArrayList path,
                     java.lang.String attribute)

      Constructs an `XmlTextInfo` with specified child position, (possibly null) xml path, and a (possibly null) attribute name.

    - #### XmlTextInfo

          public XmlTextInfo(XmlSpecialForm form)

      Constructs an `XmlTextInfo` with specified special form.

    - #### XmlTextInfo

          public XmlTextInfo(java.lang.String attribute)

      Constructs an `XmlTextInfo` with specified attribute name.

    - #### XmlTextInfo

          public XmlTextInfo(int child,
                     IntArrayList path,
                     boolean isTerminal,
                     ArrayList textInfo,
                     java.lang.String attribute)

      Constructs an `XmlTextInfo` with specified child position,

  - ### Method Detail

    - #### isSpecialForm

          public boolean isSpecialForm()

      `isSpecialForm()` returns `true` whenever this is a special form.

    - #### specialForm

          public XmlSpecialForm specialForm()

      Returns this `XmlTextInfo`'s `_specialForm`.

    - #### isXmlTreePath

          public boolean isXmlTreePath()

      `isXmlTreePath()` returns `true` whenever this is an XML tree path.

    - #### toString

          public final java.lang.String toString()

      Returns a `String` form of this `XmlTextInfo`.
      Overrides:
        `toString` in class `XmlTextInfoArg`