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

hlt.language.syntax

## Class XmlAttributeInfo

- java.lang.Object
- - hlt.language.syntax.XmlAttributeInfo

-     public class XmlAttributeInfo
      extends java.lang.Object

  This is the class of information parsed from an XML attribute annotation. This information enables computing a text value for a given attribute at parse time. Hence, what is denoted (i.e., what must be must be computed) from this information is a name/value pair, where name is an attribute name, and value is a text string manufactured at parse time from the information packaged in an `XmlTextInfo` object.
  Version:
    Last modified on Fri Apr 13 20:21:54 2012 by hak
  Author:
    Hassan Aït-Kaci
  Copyright:
    © by the author

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `XmlAttributeInfo(java.lang.String name)` Constructs an `XmlAttributeInfo` with specified name.
    `XmlAttributeInfo(java.lang.String name, int child, int[] path, java.lang.String attribute)` Constructs an `XmlAttributeInfo` with specified name, child position, an `int[]` XML path, and a (possibly null) attribute name.
    `XmlAttributeInfo(java.lang.String name, int child, IntArrayList path, java.lang.String attribute)` Constructs an `XmlAttributeInfo` with specified name, child position, an `IntArrayList` XML path, and a (possibly null) attribute name.
    `XmlAttributeInfo(java.lang.String name, XmlSpecialForm form)` Constructs an `XmlAttributeInfo` with specified name and special form.
    `XmlAttributeInfo(java.lang.String name, XmlTextInfo value)` Constructs an `XmlAttributeInfo` with specified name and value.
    `XmlAttributeInfo(java.lang.String name, XmlTreePath path)` Constructs an `XmlAttributeInfo` with specified name and `XmlTreePath`.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `java.lang.String` | `attributeNameRef()` Returns the name of the attribute referenced by the XML tree path.
    `int` | `child()` Returns the child index of this attribute's value when this value is an `XmlTreePath` object.
    `static XmlAttributeInfo` | `eltXmlAttributeInfo(java.lang.String name)` Creates and returns a new `XmlAttributeInfo` for specified attribute name to be initialized to some child XML node's text content.
    `boolean` | `hasAttribute()` Returns `true` whenever this attribute is a reference to the value of another attribute.
    `boolean` | `hasChild()` Returns `true` whenever this attribute refers to child CST.
    `boolean` | `hasLiteralValue()` Returns `true` whenever this attribute has a literak string for a value.
    `boolean` | `hasPath()` Returns `true` whenever this attribute is a reference into and XML tree with non empty XML tree address (the `int[]` path).
    `boolean` | `hasTerminalValue()` Returns `true` whenever this attribute's value represents a `$VALUE`special form.``
    `boolean` | `hasTextForm()` Returns `true` whenever this attribute's value represents a `$TEXT`special form.``
    `boolean` | `hasXmlTreePathValue()` Returns `true` whenever this attribute's value is an `XmlTreePath` object.
    `boolean` | `isDeepAttributeReference()` Returns `true` whenever this attribute's value is the valkue of a deeply nested attribute in a child's XML tree.
    `boolean` | `isSpecialForm()` Returns `true` whenever this attribute's value represents special form.
    `static XmlAttributeInfo` | `literalXmlAttributeInfo(java.lang.String name, java.lang.String literal)` Creates and returns a new `XmlAttributeInfo` for specified attribute name and literal text.
    `java.lang.String` | `name()` Returns the attribute's name.
    `static XmlAttributeInfo` | `refXmlAttributeInfo(java.lang.String name, java.lang.String ref)` Creates and returns a new `XmlAttributeInfo` for specified attribute name and attribute reference.
    `XmlAttributeInfo` | `setChild(int child)` Sets this attribute's value child position to the specified integer and returns this `XmlAttributeInfo`.
    `XmlAttributeInfo` | `setXmlPath(int[] path)` Sets this attribute's value child position to the specified integer and returns this `XmlAttributeInfo`.
    `XmlSpecialForm` | `specialForm()` Returns this attribute's value special form when it is one.
    `java.lang.String` | `toString()` Returns a `String` form for this `XmlAttributeInfo`.
    `XmlTextInfo` | `value()` Returns the attribute's value.
    `int[]` | `xmlPath()` Whenever this attribute's value is an `XmlTreePath` object, this returns the path as an `int[]`.

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

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

- - ### Constructor Detail

    - #### XmlAttributeInfo

          public XmlAttributeInfo(java.lang.String name,
                          XmlTextInfo value)

      Constructs an `XmlAttributeInfo` with specified name and value.

    - #### XmlAttributeInfo

          public XmlAttributeInfo(java.lang.String name,
                          XmlTreePath path)

      Constructs an `XmlAttributeInfo` with specified name and `XmlTreePath`.

    - #### XmlAttributeInfo

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

      Constructs an `XmlAttributeInfo` with specified name, child position, an `int[]` XML path, and a (possibly null) attribute name.

    - #### XmlAttributeInfo

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

      Constructs an `XmlAttributeInfo` with specified name, child position, an `IntArrayList` XML path, and a (possibly null) attribute name.

    - #### XmlAttributeInfo

          public XmlAttributeInfo(java.lang.String name,
                          XmlSpecialForm form)

      Constructs an `XmlAttributeInfo` with specified name and special form.

    - #### XmlAttributeInfo

          public XmlAttributeInfo(java.lang.String name)

      Constructs an `XmlAttributeInfo` with specified name.

  - ### Method Detail

    - #### refXmlAttributeInfo

          public static XmlAttributeInfo refXmlAttributeInfo(java.lang.String name,
                                             java.lang.String ref)

      Creates and returns a new `XmlAttributeInfo` for specified attribute name and attribute reference.

    - #### literalXmlAttributeInfo

          public static XmlAttributeInfo literalXmlAttributeInfo(java.lang.String name,
                                                 java.lang.String literal)

      Creates and returns a new `XmlAttributeInfo` for specified attribute name and literal text.

    - #### eltXmlAttributeInfo

          public static XmlAttributeInfo eltXmlAttributeInfo(java.lang.String name)

      Creates and returns a new `XmlAttributeInfo` for specified attribute name to be initialized to some child XML node's text content.

    - #### name

          public final java.lang.String name()

      Returns the attribute's name. (i.e., its name).

    - #### value

          public final XmlTextInfo value()

      Returns the attribute's value.

    - #### hasLiteralValue

          public final boolean hasLiteralValue()

      Returns `true` whenever this attribute has a literak string for a value.

    - #### specialForm

          public final XmlSpecialForm specialForm()

      Returns this attribute's value special form when it is one.

    - #### isSpecialForm

          public final boolean isSpecialForm()

      Returns `true` whenever this attribute's value represents special form.

    - #### hasTerminalValue

          public final boolean hasTerminalValue()

      Returns `true` whenever this attribute's value represents a `$VALUE`special form.``

    - #### hasTextForm

          public final boolean hasTextForm()

      Returns `true` whenever this attribute's value represents a `$TEXT`special form.``

    - #### hasXmlTreePathValue

          public final boolean hasXmlTreePathValue()

      Returns `true` whenever this attribute's value is an `XmlTreePath` object.

    - #### hasPath

          public final boolean hasPath()

      Returns `true` whenever this attribute is a reference into and XML tree with non empty XML tree address (the `int[]` path).

    - #### xmlPath

          public final int[] xmlPath()

      Whenever this attribute's value is an `XmlTreePath` object, this returns the path as an `int[]`.

    - #### setXmlPath

          public final XmlAttributeInfo setXmlPath(int[] path)

      Sets this attribute's value child position to the specified integer and returns this `XmlAttributeInfo`.

    - #### isDeepAttributeReference

          public final boolean isDeepAttributeReference()

      Returns `true` whenever this attribute's value is the valkue of a deeply nested attribute in a child's XML tree.

    - #### setChild

          public final XmlAttributeInfo setChild(int child)

      Sets this attribute's value child position to the specified integer and returns this `XmlAttributeInfo`.

    - #### child

          public final int child()

      Returns the child index of this attribute's value when this value is an `XmlTreePath` object.

    - #### hasChild

          public final boolean hasChild()

      Returns `true` whenever this attribute refers to child CST.

    - #### hasAttribute

          public final boolean hasAttribute()

      Returns `true` whenever this attribute is a reference to the value of another attribute.

    - #### attributeNameRef

          public final java.lang.String attributeNameRef()

      Returns the name of the attribute referenced by the XML tree path. This assumes that `_value` is an `XmlTreePath`.

    - #### toString

          public final java.lang.String toString()

      Returns a `String` form for this `XmlAttributeInfo`.
      Overrides:
        `toString` in class `java.lang.Object`