|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.opencyc.xml.XMLWriter | +--org.opencyc.xml.XMLFileWriter
Implements an XMLFileWriter with facilities for surrounding data elements with tags appropriately named and indented.
Copyright 2001 Cycorp, Inc., license is open source GNU LGPL.
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 |
public XMLFileWriter(java.lang.String outputFile) throws java.io.IOException
outputFile
- the output file nameMethod Detail |
public void indentPrint(java.lang.String string, int indent, boolean relative) throws java.io.IOException
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
).indentPrint
in class XMLWriter
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.public void print(java.lang.String string) throws java.io.IOException
FileWriter
stored in the field @see #writer.print
in class XMLWriter
string
- the string to be printed.public void flush() throws java.io.IOException
FileWriter
in the field @see #writer.flush
in class XMLWriter
public void close() throws java.io.IOException
FileWriter
in the field @see #writer.close
in class XMLWriter
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |