Arch4J 1.1

org.arch4j.xml
Class XMLHandlerAdapter

java.lang.Object
  |
  +--org.arch4j.xml.XMLHandlerAdapter
All Implemented Interfaces:
XMLHandler

public class XMLHandlerAdapter
extends Object
implements XMLHandler

This class implements the XMLHandler interface and allows you to only override methods you care about.

Author:
Allan Wick

Constructor Summary
XMLHandlerAdapter()
          Creates a new instance of XMLHandlerAdapter
 
Method Summary
 void characters(char[] buffer, int start, int length)
          this method is called when the parser encounters plain text outside of a bracketed tag.
 void endDocument()
          called when parser reaches the end of the document
 void endElement(String name)
          this method is called whenever the parser encounters the end of an element
 void error(String message, String source, int line, int column)
          this method is called by the parser if it encounters a recoverable error.
 void fatalError(String message, String source, int line, int column)
          this method is called by the parser if it encounters a non-recoverable error.
 void startDocument()
          this method is called by the parser at the start of a document
 void startElement(String name, Map attributes)
          this method is called when the parser encounters a starting element tag.
 void warning(String message, String source, int line, int column)
          this method is called by the parser if it encounters a warning situation.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLHandlerAdapter

public XMLHandlerAdapter()
Creates a new instance of XMLHandlerAdapter

Method Detail

characters

public void characters(char[] buffer,
                       int start,
                       int length)
this method is called when the parser encounters plain text outside of a bracketed tag. It provides the text in the buffer in the index range start -> end.

Specified by:
characters in interface XMLHandler
Parameters:
buffer - buffer containing plain text characters
start - start index of plain text characters in buffer
length - number of characters in plain text

endDocument

public void endDocument()
called when parser reaches the end of the document

Specified by:
endDocument in interface XMLHandler

endElement

public void endElement(String name)
this method is called whenever the parser encounters the end of an element

Specified by:
endElement in interface XMLHandler
Parameters:
name - the tag of the element that is ending

error

public void error(String message,
                  String source,
                  int line,
                  int column)
this method is called by the parser if it encounters a recoverable error.

Specified by:
error in interface XMLHandler
Parameters:
message - error message generated by parser
source - source of XML document - generally a file name
line - line number of document on which error occurred.
column - column number at which error occurred.

fatalError

public void fatalError(String message,
                       String source,
                       int line,
                       int column)
this method is called by the parser if it encounters a non-recoverable error. The parser aborts after this callback.

Specified by:
fatalError in interface XMLHandler
Parameters:
message - error message generated by parser
source - source of XML document - generally a file name
line - line number of document on which error occurred.
column - column number at which error occurred.

startDocument

public void startDocument()
this method is called by the parser at the start of a document

Specified by:
startDocument in interface XMLHandler

startElement

public void startElement(String name,
                         Map attributes)
this method is called when the parser encounters a starting element tag.

Specified by:
startElement in interface XMLHandler
Parameters:
attributes - a map of attribute names and values found in this element

warning

public void warning(String message,
                    String source,
                    int line,
                    int column)
this method is called by the parser if it encounters a warning situation.

Specified by:
warning in interface XMLHandler
Parameters:
message - error message generated by parser
source - source of XML document - generally a file name
line - line number of document on which error occurred.
column - column number at which error occurred.

Arch4J 1.1

Copyright © 2000-2004 SpiderLogic, a service of Wipfli Ullrich Bertelson LLP.