hnscnvt

## Class HNSToHML

- java.lang.Object
- - hnscnvt.HNSToHML

-     public class HNSToHML
      extends java.lang.Object

  Converter that generates the HML `<sign>` element for any given given `HNSSign`, using the ANTLR-based parsing and AST-generation support provided in packages `hamnewlex`, `hamparse`, and `hamwalk`.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `HNSToHML.HNSToHMLException` Exception class for HNS-to-HML conversion.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `HNSToHML()` Constructs a new converter of HNS signs to HML.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.w3c.dom.Element` | `hmlSign(HNSSign hsign)` Generates and returns the HML `<sign>` element for the given `HNSSign`.
    `java.lang.String` | `hmlSignAsDoc(java.lang.String hmlsign)` Wraps the given HML `<sign>` element as an HML document and returns the result.
    `java.lang.String` | `hmlSignText(org.w3c.dom.Element hmlel)` Returns the given HML element as a multi-line text.
    `java.lang.String` | `hmlSignText(HNSSign hsign)` Generates and returns the HML `<sign>` element for the given `HNSSign`.
    `java.lang.String` | `rawHMLSignText(org.w3c.dom.Element hmlel)` Returns the given HML element as a raw (typically single-line) text.
    `void` | `validateHML(java.lang.String hdoctxt)` Validates the given HML document text, throwing an `HNSToHML.HNSToHMLException` in case of failure; the presence of whitespace in an element with an EMPTY content model will be flagged as invalid.
    `void` | `validateHML(java.lang.String hdoctxt, boolean emptywsok)` Validates the given HML document text, allowing whitespace for EMPTY element content, and returning silently if successful or throwing an `HNSToHML.HNSToHMLException` in case of failure.

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

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

- - ### Constructor Detail

    - #### HNSToHML

          public HNSToHML()
                   throws HNSToHML.HNSToHMLException

      Constructs a new converter of HNS signs to HML.
      Throws:
        `HNSToHML.HNSToHMLException`

  - ### Method Detail

    - #### hmlSignAsDoc

          public java.lang.String hmlSignAsDoc(java.lang.String hmlsign)

      Wraps the given HML `<sign>` element as an HML document and returns the result.

    - #### rawHMLSignText

          public java.lang.String rawHMLSignText(org.w3c.dom.Element hmlel)
                                          throws HNSToHML.HNSToHMLException

      Returns the given HML element as a raw (typically single-line) text.
      Throws:
        `HNSToHML.HNSToHMLException`

    - #### hmlSignText

          public java.lang.String hmlSignText(org.w3c.dom.Element hmlel)
                                       throws HNSToHML.HNSToHMLException

      Returns the given HML element as a multi-line text.
      Throws:
        `HNSToHML.HNSToHMLException`

    - #### hmlSignText

          public java.lang.String hmlSignText(HNSSign hsign)
                                       throws HNSToHML.HNSToHMLException

      Generates and returns the HML `<sign>` element for the given `HNSSign`.
      Throws:
        `HNSToHML.HNSToHMLException`

    - #### hmlSign

          public org.w3c.dom.Element hmlSign(HNSSign hsign)
                                      throws HNSToHML.HNSToHMLException

      Generates and returns the HML `<sign>` element for the given `HNSSign`.
      Throws:
        `HNSToHML.HNSToHMLException`

    - #### validateHML

          public void validateHML(java.lang.String hdoctxt,
                                  boolean emptywsok)
                           throws HNSToHML.HNSToHMLException

      Validates the given HML document text, allowing whitespace for EMPTY element content, and returning silently if successful or throwing an `HNSToHML.HNSToHMLException` in case of failure.
      Throws:
        `HNSToHML.HNSToHMLException`

    - #### validateHML

          public void validateHML(java.lang.String hdoctxt)
                           throws HNSToHML.HNSToHMLException

      Validates the given HML document text, throwing an `HNSToHML.HNSToHMLException` in case of failure; the presence of whitespace in an element with an EMPTY content model will be flagged as invalid.
      Throws:
        `HNSToHML.HNSToHMLException`