com.mmm.cms.homehealth.io
Class HomeHealthXMLHandler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.mmm.cms.homehealth.io.HomeHealthXMLHandler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

This class parses an XML file building a list of Home Health Record IF objects. The list is accessible at the end of the processing


Constructor Summary
HomeHealthXMLHandler()
           
HomeHealthXMLHandler(java.util.List<HomeHealthRecordIF> recordList)
           
 
Method Summary
 void characters(char[] chars, int startIdx, int endIdx)
           
 void clearRecords()
           
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qualifiedName)
           
protected  java.lang.reflect.Method getMethod(java.lang.String fieldName, java.lang.Class[] params)
          This assumes that the methods are overloaded, so there is only one per field name.
 java.util.List<HomeHealthRecordIF> getRecords()
          Get the value of records
 int readWith(java.io.InputStream inputStream)
           
 void setRecords(java.util.List<HomeHealthRecordIF> records)
          Set the value of records
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qualifiedName, org.xml.sax.Attributes arg3)
           
 
Methods inherited from class org.xml.sax.helpers.DefaultHandler
endDocument, endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HomeHealthXMLHandler

public HomeHealthXMLHandler()

HomeHealthXMLHandler

public HomeHealthXMLHandler(java.util.List<HomeHealthRecordIF> recordList)
Method Detail

getRecords

public java.util.List<HomeHealthRecordIF> getRecords()
Get the value of records

Returns:
the value of records

setRecords

public void setRecords(java.util.List<HomeHealthRecordIF> records)
Set the value of records

Parameters:
records - new value of records

clearRecords

public void clearRecords()

readWith

public int readWith(java.io.InputStream inputStream)

characters

public void characters(char[] chars,
                       int startIdx,
                       int endIdx)
                throws org.xml.sax.SAXException
Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qualifiedName)
                throws org.xml.sax.SAXException
Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException

getMethod

protected java.lang.reflect.Method getMethod(java.lang.String fieldName,
                                             java.lang.Class[] params)
                                      throws java.lang.NoSuchMethodException
This assumes that the methods are overloaded, so there is only one per field name.

Parameters:
fieldName -
params -
Returns:
Throws:
java.lang.NoSuchMethodException

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qualifiedName,
                         org.xml.sax.Attributes arg3)
                  throws org.xml.sax.SAXException
Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler
Throws:
org.xml.sax.SAXException