tomp.quiz
Class QuestionFilter

java.lang.Object
  extended bytomp.xtcl.filter.XTFilterImpl
      extended bytomp.quiz.QuestionFilter
All Implemented Interfaces:
org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler, org.xml.sax.ext.LexicalHandler, Parametrized, org.xml.sax.XMLFilter, org.xml.sax.XMLReader, XTFilter

public class QuestionFilter
extends XTFilterImpl


Field Summary
static java.lang.String ANSWER
           
static java.lang.String ANSWER_CORRECT
           
protected  int answerIndex
           
static java.lang.String CORRECT
           
static java.lang.String CORRECT_ATTR_NAME
           
static java.lang.String DOCBOOK_NS_URI
           
static java.lang.String PARA
           
static java.lang.String POINTS_ATTR_NAME
           
static java.lang.String POINTS_IDENTIF
           
static java.lang.String QANDAENTRY
           
static java.lang.String QUESTION
           
protected  java.util.Set questions
           
protected  QuizFactory quizFactory
           
protected  java.util.List st
           
protected  Question topQuestion
           
static java.lang.String TYPE_ATTR_NAME
           
 
Fields inherited from class tomp.xtcl.filter.XTFilterImpl
contentHandler, dtdHandler, entityResolver, errorHandler, lexicalHandler, locator, parent
 
Constructor Summary
QuestionFilter()
           
 
Method Summary
static void dumpMap(java.util.Map qs)
           
static void dumpSet(java.util.Set qs)
           
 void endDocument()
          Filter an end document event.
 void endElement(java.lang.String uri, java.lang.String localName, java.lang.String qName)
          Filter an end element event.
 java.util.Set getQuestions()
           
 void characters(char[] ch, int start, int length)
          Filter a character data event.
protected  void pop()
           
protected  void push(java.lang.String s)
           
protected  void putQuestion(Question q)
           
protected  void setAnswerCorrect(Question q, int aIndex)
           
protected  void setAnswerCorrectContent(Question q, int aIndex, java.lang.String content)
           
 void startDocument()
          Filter a start document event.
 void startElement(java.lang.String uri, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes atts)
          Filter a start element event.
protected  java.lang.String top()
           
protected  java.lang.String top(int index)
           
 
Methods inherited from class tomp.xtcl.filter.XTFilterImpl
comment, endCDATA, endDTD, endEntity, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getLexicalHandler, getParent, getProperty, ignorableWhitespace, notationDecl, parse, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setLexicalHandler, setParameter, setParent, setProperty, setupParse, skippedEntity, startCDATA, startDTD, startEntity, startPrefixMapping, unparsedEntityDecl, warning
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DOCBOOK_NS_URI

public static final java.lang.String DOCBOOK_NS_URI
See Also:
Constant Field Values

TYPE_ATTR_NAME

public static final java.lang.String TYPE_ATTR_NAME
See Also:
Constant Field Values

CORRECT_ATTR_NAME

public static final java.lang.String CORRECT_ATTR_NAME
See Also:
Constant Field Values

POINTS_ATTR_NAME

public static final java.lang.String POINTS_ATTR_NAME
See Also:
Constant Field Values

POINTS_IDENTIF

public static final java.lang.String POINTS_IDENTIF
See Also:
Constant Field Values

CORRECT

public static final java.lang.String CORRECT
See Also:
Constant Field Values

QANDAENTRY

public static final java.lang.String QANDAENTRY
See Also:
Constant Field Values

QUESTION

public static final java.lang.String QUESTION
See Also:
Constant Field Values

ANSWER

public static final java.lang.String ANSWER
See Also:
Constant Field Values

ANSWER_CORRECT

public static final java.lang.String ANSWER_CORRECT
See Also:
Constant Field Values

PARA

public static final java.lang.String PARA
See Also:
Constant Field Values

questions

protected java.util.Set questions

topQuestion

protected Question topQuestion

quizFactory

protected QuizFactory quizFactory

answerIndex

protected int answerIndex

st

protected java.util.List st
Constructor Detail

QuestionFilter

public QuestionFilter()
Method Detail

getQuestions

public java.util.Set getQuestions()

push

protected void push(java.lang.String s)

top

protected java.lang.String top(int index)

top

protected java.lang.String top()

pop

protected void pop()

startDocument

public void startDocument()
                   throws org.xml.sax.SAXException
Description copied from class: XTFilterImpl
Filter a start document event.

Specified by:
startDocument in interface org.xml.sax.ContentHandler
Overrides:
startDocument in class XTFilterImpl
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

endDocument

public void endDocument()
                 throws org.xml.sax.SAXException
Description copied from class: XTFilterImpl
Filter an end document event.

Specified by:
endDocument in interface org.xml.sax.ContentHandler
Overrides:
endDocument in class XTFilterImpl
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

startElement

public void startElement(java.lang.String uri,
                         java.lang.String localName,
                         java.lang.String qName,
                         org.xml.sax.Attributes atts)
                  throws org.xml.sax.SAXException
Description copied from class: XTFilterImpl
Filter a start element event.

Specified by:
startElement in interface org.xml.sax.ContentHandler
Overrides:
startElement in class XTFilterImpl
Parameters:
uri - The element's Namespace URI, or the empty string.
localName - The element's local name, or the empty string.
qName - The element's qualified (prefixed) name, or the empty string.
atts - The element's attributes.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

setAnswerCorrect

protected void setAnswerCorrect(Question q,
                                int aIndex)

setAnswerCorrectContent

protected void setAnswerCorrectContent(Question q,
                                       int aIndex,
                                       java.lang.String content)

putQuestion

protected void putQuestion(Question q)

endElement

public void endElement(java.lang.String uri,
                       java.lang.String localName,
                       java.lang.String qName)
                throws org.xml.sax.SAXException
Description copied from class: XTFilterImpl
Filter an end element event.

Specified by:
endElement in interface org.xml.sax.ContentHandler
Overrides:
endElement in class XTFilterImpl
Parameters:
uri - The element's Namespace URI, or the empty string.
localName - The element's local name, or the empty string.
qName - The element's qualified (prefixed) name, or the empty string.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

characters

public void characters(char[] ch,
                       int start,
                       int length)
                throws org.xml.sax.SAXException
Description copied from class: XTFilterImpl
Filter a character data event.

Specified by:
characters in interface org.xml.sax.ContentHandler
Overrides:
characters in class XTFilterImpl
Parameters:
ch - An array of characters.
start - The starting position in the array.
length - The number of characters to use from the array.
Throws:
org.xml.sax.SAXException - The client may throw an exception during processing.

dumpMap

public static void dumpMap(java.util.Map qs)

dumpSet

public static void dumpSet(java.util.Set qs)