org.progeeks.util.xml
Class TagReader

java.lang.Object
  extended by org.progeeks.util.xml.TagReader
Direct Known Subclasses:
ObjectXmlReader.ObjectTagReader, SimpleXmlReader.SimpleTagReader

public class TagReader
extends java.lang.Object

Handles the operations necessary to create an object for the associated tag type.

Version:
$Revision: 1.4 $
Author:
Paul Speed

Constructor Summary
TagReader()
           
 
Method Summary
 void tagEnd(java.lang.String tag, java.lang.String text, java.lang.Object parent, java.lang.Object tagObject)
          Performs any operations necessary to close a tag.
 java.lang.Object tagStart(java.lang.String tag, org.xml.sax.Attributes atts, java.lang.Object parent)
          Called at the beginning of a tag so that the initial tag object can be created.
 void tagText(java.lang.String tag, java.lang.String text, java.lang.StringBuffer buffer, java.lang.Object parent, java.lang.Object tagObject)
          Called when a new section of text is parsed from the body of the tag.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TagReader

public TagReader()
Method Detail

tagStart

public java.lang.Object tagStart(java.lang.String tag,
                                 org.xml.sax.Attributes atts,
                                 java.lang.Object parent)
                          throws XmlException
Called at the beginning of a tag so that the initial tag object can be created. The default implementation returns the tag name string for debugging.

Parameters:
tag - The name of the processed tag.
atts - The attribute list for the tag.
parent - The object within which this tag is nested.
Throws:
XmlException

tagText

public void tagText(java.lang.String tag,
                    java.lang.String text,
                    java.lang.StringBuffer buffer,
                    java.lang.Object parent,
                    java.lang.Object tagObject)
             throws XmlException
Called when a new section of text is parsed from the body of the tag. The default implementation just accumulates the new text into the provided buffer.

Parameters:
tag - The name of the tag being processed.
text - The new text that was read.
buffer - A buffer that can be used to accumulate the processed text.
parent - The object within which this tag is nested.
tagObject - The object created in the tagStart method.
Throws:
XmlException

tagEnd

public void tagEnd(java.lang.String tag,
                   java.lang.String text,
                   java.lang.Object parent,
                   java.lang.Object tagObject)
            throws XmlException
Performs any operations necessary to close a tag.

Parameters:
tag - The name of the processed tag.
text - The text accumulated in the tag body.
parent - The object within which this tag is nested.
tagObject - The object created in the tagStart method.
Throws:
XmlException


Copyright © 2002-2003 Paul Speed. All Rights Reserved.