net.sourceforge.pavlov.user
Class UserXMLHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by net.sourceforge.pavlov.user.UserXMLHandler
All Implemented Interfaces:
ContentHandler, DTDHandler, EntityResolver, ErrorHandler

public final class UserXMLHandler
extends DefaultHandler

Loads a User from an XML file.


Constructor Summary
UserXMLHandler()
           
 
Method Summary
 void characters(char[] ch, int start, int length)
          Describe characters method here.
 void endDocument()
          Describe endDocument method here.
 void endElement(String namespaceURI, String localName, String qName)
          Describe endElement method here.
 User getUser()
          Return the loaded user
 void startDocument()
          Describe startDocument method here.
 void startElement(String namespaceURI, String localName, String qName, Attributes attr)
          Describe startElement method here.
 
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
 

Constructor Detail

UserXMLHandler

public UserXMLHandler()
Method Detail

startDocument

public void startDocument()
                   throws SAXException
Describe startDocument method here.

Specified by:
startDocument in interface ContentHandler
Overrides:
startDocument in class DefaultHandler
Throws:
SAXException - if an error occurs

endDocument

public void endDocument()
                 throws SAXException
Describe endDocument method here.

Specified by:
endDocument in interface ContentHandler
Overrides:
endDocument in class DefaultHandler
Throws:
SAXException - if an error occurs

startElement

public void startElement(String namespaceURI,
                         String localName,
                         String qName,
                         Attributes attr)
                  throws SAXException
Describe startElement method here.

Specified by:
startElement in interface ContentHandler
Overrides:
startElement in class DefaultHandler
Parameters:
namespaceURI - a String value
localName - a String value
qName - a String value
attr - an Attributes value
Throws:
SAXException - if an error occurs

endElement

public void endElement(String namespaceURI,
                       String localName,
                       String qName)
                throws SAXException
Describe endElement method here.

Specified by:
endElement in interface ContentHandler
Overrides:
endElement in class DefaultHandler
Parameters:
namespaceURI - a String value
localName - a String value
qName - a String value
Throws:
SAXException - if an error occurs

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws SAXException
Describe characters method here.

Specified by:
characters in interface ContentHandler
Overrides:
characters in class DefaultHandler
Parameters:
ch - a char[] value
start - an int value
length - an int value
Throws:
SAXException - if an error occurs

getUser

public User getUser()
Return the loaded user

Returns:
an User value