## org.opencyc.xml
Class XMLFileWriter

    java.lang.Object
      |
      +--org.opencyc.xml.XMLWriter
            |
            +--org.opencyc.xml.XMLFileWriter

public class XMLFileWriter
extends XMLWriter

Implements an XMLFileWriter with facilities for surrounding data elements with tags appropriately named and indented.

Author:
  Stefano Bertolo

  Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.

  the license

  www.opencyc.org

  OpenCyc at SourceForge

  THIS SOFTWARE AND KNOWLEDGE BASE CONTENT ARE PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OPENCYC ORGANIZATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE AND KNOWLEDGE BASE CONTENT, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Constructor Summary
`XMLFileWriter(java.lang.String outputFile)` Constructs a XMLFileWriter object given an output file name

Method Summary
`void` `close()` Closes the `FileWriter` in the field @see #writer.
`void` `flush()` Flushes the `FileWriter` in the field @see #writer.
`void` `indentPrint(java.lang.String string, int indent, boolean relative)` Prints a string to the `FileWriter` stored in the field @see #writer indenting it by the number of spaces indicated by @see #indent either relative to the current indentation level (if @see #relative is `true`) or with respect to the beginning of the line (if @see #relative is `false`).
`void` `print(java.lang.String string)` Prints a string to the `FileWriter` stored in the field @see #writer.

Methods inherited from class org.opencyc.xml.XMLWriter
`getIndentLength, indentPrintln, indentPrintSafe, indentPrintSafeln, introduceXMLEntities, printSafe, printXMLAtomicTag, printXMLAtomicTag, printXMLAtomicTag, printXMLEndTag, printXMLEndTag, printXMLStartTag, printXMLStartTag, printXMLStartTag, printXMLStartTag, resetIndent, setIndent`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### XMLFileWriter

    public XMLFileWriter(java.lang.String outputFile)
                  throws java.io.IOException

  Constructs a XMLFileWriter object given an output file name
  Parameters:
    `outputFile` - the output file name

Method Detail

### indentPrint

    public void indentPrint(java.lang.String string,
                            int indent,
                            boolean relative)
                     throws java.io.IOException

  Prints a string to the `FileWriter` stored in the field @see #writer indenting it by the number of spaces indicated by @see #indent either relative to the current indentation level (if @see #relative is `true`) or with respect to the beginning of the line (if @see #relative is `false`).
  Overrides:
    `indentPrint` in class `XMLWriter`
  Parameters:
    `string` - the string to be printed.
    `indent` - the number of spaces by which the string needs to be indented.
    `relative` - id `true` the string is further indented with respect to the current indentation level, if `false` is indented with respect to the beginning of the line.

### print

    public void print(java.lang.String string)
               throws java.io.IOException

  Prints a string to the `FileWriter` stored in the field @see #writer.
  Overrides:
    `print` in class `XMLWriter`
  Parameters:
    `string` - the string to be printed.

### flush

    public void flush()
               throws java.io.IOException

  Flushes the `FileWriter` in the field @see #writer.
  Overrides:
    `flush` in class `XMLWriter`

### close

    public void close()
               throws java.io.IOException

  Closes the `FileWriter` in the field @see #writer.
  Overrides:
    `close` in class `XMLWriter`