The Encog Project

org.encog.parse.tags.write
Class WriteTags

java.lang.Object
  extended by org.encog.parse.tags.write.WriteTags
Direct Known Subclasses:
WriteXML

public class WriteTags
extends java.lang.Object

Class used to write out tags, such as XML or HTML.

Author:
jheaton

Constructor Summary
WriteTags(java.io.OutputStream output)
          Construct an object to write tags.
 
Method Summary
 void addAttribute(java.lang.String name, java.lang.String value)
          Add an attribute to be written with the next tag.
 void addCDATA(java.lang.String text)
          Add CDATA to the output stream.
 void addProperty(java.lang.String name, double d)
          Add a property as a double.
 void addProperty(java.lang.String name, int i)
          Add a property as an integer.
 void addProperty(java.lang.String name, java.lang.String str)
          Add a property as a string.
 void addText(java.lang.String text)
          Add text.
 void beginDocument()
          Called to begin the document.
 void beginTag(java.lang.String name)
          Begin a tag with the specified name.
 void close()
          Close this object.
 void endDocument()
          End the document.
 void endTag()
          End the current tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

WriteTags

public WriteTags(java.io.OutputStream output)
Construct an object to write tags.

Parameters:
output - THe output stream.
Method Detail

addAttribute

public void addAttribute(java.lang.String name,
                         java.lang.String value)
Add an attribute to be written with the next tag.

Parameters:
name - The name of the attribute.
value - The value of the attribute.

addCDATA

public void addCDATA(java.lang.String text)
Add CDATA to the output stream. XML allows a large block of unformatted text to be added as a CDATA tag.

Parameters:
text - The text to add.

addProperty

public void addProperty(java.lang.String name,
                        double d)
Add a property as a double. A property is a value enclosed in two tags.

Parameters:
name - The name of the enclosing tags.
d - The value to store.

addProperty

public void addProperty(java.lang.String name,
                        int i)
Add a property as an integer. A property is a value enclosed in two tags.

Parameters:
name - The name of the enclosing tags.
i - The value to store.

addProperty

public void addProperty(java.lang.String name,
                        java.lang.String str)
Add a property as a string. A property is a value enclosed in two tags.

Parameters:
name - The name of the enclosing tags.
str - The value to store.

addText

public void addText(java.lang.String text)
Add text.

Parameters:
text - The text to add.

beginDocument

public void beginDocument()
Called to begin the document.


beginTag

public void beginTag(java.lang.String name)
Begin a tag with the specified name.

Parameters:
name - The tag to begin.

close

public void close()
Close this object.


endDocument

public void endDocument()
End the document.


endTag

public void endTag()
End the current tag.


The Encog Project