com.mytrendtimer.trendtimer
Class SAX2Handler

java.lang.Object
  extended by org.xml.sax.helpers.DefaultHandler
      extended by com.mytrendtimer.trendtimer.SAX2Handler
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

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

Technical class just to handle the xml configuration file with SAX2.

Version:
v0.99.94
Author:
FRM

Constructor Summary
SAX2Handler(java.lang.String intrIDtoFindArg)
          Main constructor
 
Method Summary
 void characters(char[] buffer, int start, int length)
          When the parser encounters plain text (not XML elements), it calls this method, which accumulates them in a string buffer.
 void endDocument()
          Called at the end of parsing.
 void endElement(java.lang.String namespaceURL, java.lang.String localName, java.lang.String qname)
          Take special action when we reach the end of selected elements.
 java.lang.String getArg0Name()
           
 java.lang.String getArg1Name()
           
 java.lang.String getBaseDirName()
           
 java.lang.String getChartImgGenerationName()
           
 java.lang.String getChartStartYearName()
           
 java.lang.String getCommentName()
           
 java.lang.String getCsvOutputGeneration()
           
 java.lang.String getCurrencyName()
           
 java.lang.String getFilter()
           
 java.lang.String getFullnameName()
           
 java.lang.String getHtmlTransformationName()
           
 java.lang.String getInstrId()
           
 java.util.ArrayList<java.lang.String> getListAllInstr()
           
 java.lang.String getMaxDailyPercQuoteChangeWarnName()
           
 java.lang.String getMaxDayGapWarnName()
           
 java.lang.String getMaxYaxisName()
           
 java.lang.String getMinYaxisName()
           
 java.lang.String getNbrOfDigitsName()
           
 java.lang.String getPeriodicPerfgenerationName()
           
 java.lang.String getQuoteFileDefautPathName()
           
 java.lang.String getStatgenerationName()
           
 java.lang.String getSymbolName()
           
 java.lang.String getUnderlyingName()
           
 java.lang.String getWebRootName()
           
 boolean getWeWantIt()
           
 void setFilter(java.lang.String filterArg)
           
 void setWeWantIt(boolean weWantIt)
           
 void startDocument()
          Called at the beginning of parsing.
 void startElement(java.lang.String namespaceURLArg, java.lang.String localNameArg, java.lang.String qnameArg, org.xml.sax.Attributes attributesArg)
          At the beginning of each new element, erase any accumulated text.
 java.lang.String toString()
          Used to debug this class and show what was retrived in the xml config file.
 
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
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SAX2Handler

public SAX2Handler(java.lang.String intrIDtoFindArg)
Main constructor

Parameters:
intrIDtoFindArg - the instrument id (retreived from file name) which is used as a key to find corresponding data
Method Detail

characters

public void characters(char[] buffer,
                       int start,
                       int length)
When the parser encounters plain text (not XML elements), it calls this method, which accumulates them in a string buffer. Note that this method may be called multiple times, even with no intervening elements.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class org.xml.sax.helpers.DefaultHandler

endDocument

public void endDocument()
Called at the end of parsing. We just log this info.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class org.xml.sax.helpers.DefaultHandler

endElement

public void endElement(java.lang.String namespaceURL,
                       java.lang.String localName,
                       java.lang.String qname)
Take special action when we reach the end of selected elements. Although we don't use a validating parser, this method does assume that the config .xml file we're parsing is valid.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class org.xml.sax.helpers.DefaultHandler

getArg0Name

public java.lang.String getArg0Name()
Returns:
Returns the arg0Name.

getArg1Name

public java.lang.String getArg1Name()
Returns:
Returns the arg1Name.

getBaseDirName

public java.lang.String getBaseDirName()
Returns:
Returns the baseDirName.

getChartImgGenerationName

public java.lang.String getChartImgGenerationName()
Returns:
Returns the chartImgGenerationName

getChartStartYearName

public java.lang.String getChartStartYearName()
Returns:
Returns the chartStartYearName

getCommentName

public java.lang.String getCommentName()
Returns:
Returns the commentName.

getCsvOutputGeneration

public java.lang.String getCsvOutputGeneration()
Returns:
Returns the csvoutputgenerationName

getCurrencyName

public java.lang.String getCurrencyName()
Returns:
Returns the currencyName.

getFilter

public java.lang.String getFilter()
Returns:
Returns the filter.

getFullnameName

public java.lang.String getFullnameName()
Returns:
Returns the fullnameName.

getHtmlTransformationName

public java.lang.String getHtmlTransformationName()
Returns:
Returns the htmlTransformationName.

getInstrId

public java.lang.String getInstrId()
Returns:
Returns the instrId.

getListAllInstr

public java.util.ArrayList<java.lang.String> getListAllInstr()
Returns:
Returns an ArrayList of all the attribute id of the element instrument. We use generic to avoid any type problem.

getMaxDailyPercQuoteChangeWarnName

public java.lang.String getMaxDailyPercQuoteChangeWarnName()
Returns:
Returns the maxDailyPercQuoteChangeWarnName.

getMaxDayGapWarnName

public java.lang.String getMaxDayGapWarnName()
Returns:
Returns the maxDayGapWarnName.

getMaxYaxisName

public java.lang.String getMaxYaxisName()
Returns:
Returns the maxYaxisName

getMinYaxisName

public java.lang.String getMinYaxisName()
Returns:
Returns the minYaxisName

getNbrOfDigitsName

public java.lang.String getNbrOfDigitsName()
Returns:
Returns the nbrOfDigitsName

getPeriodicPerfgenerationName

public java.lang.String getPeriodicPerfgenerationName()
Returns:
Returns the periodicperfgenerationName

getQuoteFileDefautPathName

public java.lang.String getQuoteFileDefautPathName()
Returns:
Returns the QuoteFileDefautPathName

getStatgenerationName

public java.lang.String getStatgenerationName()
Returns:
Returns the statgenerationName

getSymbolName

public java.lang.String getSymbolName()
Returns:
Returns the symbolName.

getUnderlyingName

public java.lang.String getUnderlyingName()
Returns:
Returns the underlyingName

getWebRootName

public java.lang.String getWebRootName()
Returns:
Returns the webRootName.

getWeWantIt

public boolean getWeWantIt()
Returns:
Returns the weWantIt.

setFilter

public void setFilter(java.lang.String filterArg)
Parameters:
filterArg - The filter to set.

setWeWantIt

public void setWeWantIt(boolean weWantIt)
Parameters:
weWantIt - The weWantIt to set.

startDocument

public void startDocument()
Called at the beginning of parsing. We use it as an init() method.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class org.xml.sax.helpers.DefaultHandler

startElement

public void startElement(java.lang.String namespaceURLArg,
                         java.lang.String localNameArg,
                         java.lang.String qnameArg,
                         org.xml.sax.Attributes attributesArg)
At the beginning of each new element, erase any accumulated text.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class org.xml.sax.helpers.DefaultHandler

toString

public java.lang.String toString()
Used to debug this class and show what was retrived in the xml config file.

Overrides:
toString in class java.lang.Object