no.feide.moria.servlet
Class AttribsHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by no.feide.moria.servlet.AttribsHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

public class AttribsHandler
extends org.xml.sax.helpers.DefaultHandler

Version:
$Revision: 1.11 $ The AttribsHandler class extends the xml DefaultHandler to read the simple attribute description file.
Author:
Eva Indal

Field Summary
private  java.util.HashMap adata
          Hash map of parsed attributes.
private  AttribsData currentattribute
          The attribute being parsed.
private  java.lang.String currentchars
          String value of current attribute.
private  int indexcounter
          Attribute's number.
 
Constructor Summary
AttribsHandler()
          Constructor.
 
Method Summary
 void characters(char[] buf, int offset, int len)
          Implements callback that is called to process data for an element.
 void endDocument()
          Implements callback that is called at end of document.
 void endElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName)
          Implements callback that is called at end of an xml element.
 java.util.HashMap getAttribs()
          Gets parsed attributes.
 void startDocument()
          Implements callback that is called at start of document.
 void startElement(java.lang.String namespaceURI, java.lang.String sName, java.lang.String qName, org.xml.sax.Attributes attrs)
          Implements callback that is called at start of an xml element.
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

adata

private java.util.HashMap adata
Hash map of parsed attributes.


currentattribute

private AttribsData currentattribute
The attribute being parsed.


currentchars

private java.lang.String currentchars
String value of current attribute.


indexcounter

private int indexcounter
Attribute's number.

Constructor Detail

AttribsHandler

public AttribsHandler()
Constructor.

Method Detail

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Implements callback that is called at start of document. Empty for now.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException - Required by interface.

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Implements callback that is called at end of document. Empty for now.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException - Required by interface.

startElement

public final void startElement(java.lang.String namespaceURI,
                               java.lang.String sName,
                               java.lang.String qName,
                               org.xml.sax.Attributes attrs)
                        throws org.xml.sax.SAXException
Implements callback that is called at start of an xml element.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
namespaceURI - Namespace URI.
sName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified name (with prefix), or the empty string if qualified names are not available.
attrs - The specified or defaulted attributes.
Throws:
org.xml.sax.SAXException - Required by interface.
See Also:
for information about the parameters

endElement

public final void endElement(java.lang.String namespaceURI,
                             java.lang.String sName,
                             java.lang.String qName)
                      throws org.xml.sax.SAXException
Implements callback that is called at end of an xml element.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Parameters:
namespaceURI - Namespace URI.
sName - The local name (without prefix), or the empty string if Namespace processing is not being performed.
qName - The qualified XML 1.0 name (with prefix), or the empty string if qualified names are not available.
Throws:
org.xml.sax.SAXException - Required by interface.
See Also:
for information about the parameters

characters

public final void characters(char[] buf,
                             int offset,
                             int len)
                      throws org.xml.sax.SAXException
Implements callback that is called to process data for an element.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Parameters:
buf - The characters.
offset - The start position in the character array.
len - The number of characters to use from the character array.
Throws:
org.xml.sax.SAXException - Required by interface.
See Also:
for information about the parameters

getAttribs

public final java.util.HashMap getAttribs()
Gets parsed attributes. Each element in the returned HashMap is an AttribsData instance

Returns:
The parsed attributes.


Copyright © 2001-2006 UNINETT FAS. All Rights Reserved.