edu.northwestern.at.morphadorner.xgtagger

## Class XGMisc

- java.lang.Object
- - edu.northwestern.at.morphadorner.xgtagger.XGMisc

-     public class XGMisc
      extends java.lang.Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static boolean` | `allowLS30` Allow use of LS 3.0 features for output.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `XGMisc()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static java.io.File` | `getFile(java.lang.String strFileName)` Returns a file from its name.
    `static int` | `printNodeToFile(org.w3c.dom.Node node, java.lang.String outputName)` Print a `Node` into a file.
    `static java.lang.String` | `printNodeToString(org.w3c.dom.Node node)` Print a `Node` into a string.
    `static void` | `write(java.lang.String strText, java.lang.String strFileName)` Writes a text into a file.

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

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

- - ### Field Detail

    - #### allowLS30

          protected static boolean allowLS30

      Allow use of LS 3.0 features for output.

  - ### Constructor Detail

    - #### XGMisc

          public XGMisc()

  - ### Method Detail

    - #### printNodeToFile

          public static int printNodeToFile(org.w3c.dom.Node node,
                            java.lang.String outputName)
                                     throws java.io.IOException,
                                            java.io.FileNotFoundException

      Print a `Node` into a file.
      Parameters:
        `node` - The `Node` to print.
        `outputName` - The name out the output file.
      Returns:
        `-1` if the operation failed, `1` otherwise.
      Throws:
        `java.io.IOException`
        `java.io.FileNotFoundException`

    - #### printNodeToString

          public static java.lang.String printNodeToString(org.w3c.dom.Node node)
                                                    throws java.io.IOException,
                                                           java.io.FileNotFoundException

      Print a `Node` into a string.
      Parameters:
        `node` - the `Node` to print
      Returns:
        XML string if operation succeeded, null otherwise.
      Throws:
        `java.io.IOException`
        `java.io.FileNotFoundException`

    - #### getFile

          public static java.io.File getFile(java.lang.String strFileName)
                                      throws java.io.IOException

      Returns a file from its name. Expands environment variables and get canonical path.
      Parameters:
        `strFileName` - the initial file name
      Returns:
        File
      Throws:
        `java.io.IOException`

    - #### write

          public static void write(java.lang.String strText,
                   java.lang.String strFileName)
                            throws java.io.IOException

      Writes a text into a file.
      Parameters:
        `strText` - The text to write.
        `strFileName` - The URI of the file.
      Throws:
        `java.io.IOException` - If file cannot be written.