edu.isi.pegasus.planner.catalog.site.classes

## Class AbstractXMLPrintVisitor

- java.lang.Object
- - edu.isi.pegasus.planner.catalog.site.classes.AbstractXMLPrintVisitor

All Implemented Interfaces:
  SiteDataVisitor

Direct Known Subclasses:
  XML3PrintVisitor, XML4PrintVisitor

    public abstract class AbstractXMLPrintVisitor
    extends java.lang.Object
    implements SiteDataVisitor

The base class to be used by the various visitor implementors for displaying the Site Catalog in different XML formats

Version:
  $Revision$
Author:
  Karan Vahi

### Field Summary

Fields
`protected int` `mCurrentIndentIndex` The number of tabs to use for current indent
`protected java.lang.String` `mNewLine` The new line character to be used
`protected java.io.Writer` `mWriter` The internal writer

### Constructor Summary

Constructors
Constructor and Description
`AbstractXMLPrintVisitor()`

### Method Summary

All Methods Instance Methods Concrete Methods
`void` `closeElement(java.lang.String element)` Generates a closing tag for an element
`void` `decrementIndentIndex()` Decrements the indent index
`void` `depart(SiteData data)`
`java.lang.String` `getCurrentIndent()` Returns the current indent to be used while writing out
`java.lang.String` `getNextIndent()` Returns the indent to be used for the nested element.
`void` `incrementIndentIndex()` Increments the indent index
`void` `initialize(java.io.Writer writer)` Initialize the visitor implementation
`void` `visit(SiteData data)`
`void` `writeAttribute(java.lang.String key, java.lang.String value)` Writes an attribute to the stream.
`void` `writeAttribute(java.io.Writer writer, java.lang.String key, java.lang.String value)` Writes an attribute to the stream.

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

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

### Methods inherited from interface edu.isi.pegasus.planner.catalog.site.classes.SiteDataVisitor

`depart, depart, depart, depart, depart, depart, depart, visit, visit, visit, visit, visit, visit, visit`

### Field Detail

#### mWriter

    protected java.io.Writer mWriter

The internal writer

#### mNewLine

    protected java.lang.String mNewLine

The new line character to be used

#### mCurrentIndentIndex

    protected int mCurrentIndentIndex

The number of tabs to use for current indent

### Constructor Detail

#### AbstractXMLPrintVisitor

    public AbstractXMLPrintVisitor()

### Method Detail

#### initialize

    public void initialize(java.io.Writer writer)

Initialize the visitor implementation

Specified by:
  `initialize` in interface `SiteDataVisitor`
Parameters:
  `writer` - the writer

#### writeAttribute

    public void writeAttribute(java.lang.String key,
                               java.lang.String value)
                        throws java.io.IOException

Writes an attribute to the stream. Wraps the value in quotes as required by XML.

Parameters:
  `key` - the attribute key
  `value` - the attribute value
Throws:
  `java.io.IOException`

#### writeAttribute

    public void writeAttribute(java.io.Writer writer,
                               java.lang.String key,
                               java.lang.String value)
                        throws java.io.IOException

Writes an attribute to the stream. Wraps the value in quotes as required by XML.

Parameters:
  `writer` - the stream to write to
  `key` - the attribute key
  `value` - the attribute value
Throws:
  `java.io.IOException`

#### getCurrentIndent

    public java.lang.String getCurrentIndent()

Returns the current indent to be used while writing out

Returns:
  the current indent

#### getNextIndent

    public java.lang.String getNextIndent()

Returns the indent to be used for the nested element.

Returns:
  the new indent

#### incrementIndentIndex

    public void incrementIndentIndex()

Increments the indent index

#### decrementIndentIndex

    public void decrementIndentIndex()

Decrements the indent index

#### closeElement

    public void closeElement(java.lang.String element)
                      throws java.io.IOException

Generates a closing tag for an element

Parameters:
  `element` - the element tag name
Throws:
  `java.io.IOException`

#### visit

    public void visit(SiteData data)
               throws java.io.IOException

Specified by:
  `visit` in interface `SiteDataVisitor`
Throws:
  `java.io.IOException`

#### depart

    public void depart(SiteData data)
                throws java.io.IOException

Specified by:
  `depart` in interface `SiteDataVisitor`
Throws:
  `java.io.IOException`