|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.waveset.util.AbstractXmlObject
com.waveset.policy.LighthouseAccountPolicy.Question
A class used to represent one authentication question.
We need to support editing of the question text, without losing the association of answers to these questions that have already been gathered. To do this, each question must have a generated unique id, similar to the id we generate for persistent objects. This will always serve as the reference handle from an answer to the question.
Hmm, instead of storing the question text, should we be storing a key in to the message catalog?
Field Summary | |
static java.lang.String |
ELEMENT
Name of the serialized XML element. |
Fields inherited from class com.waveset.util.AbstractXmlObject |
_trace, code_id |
Constructor Summary | |
LighthouseAccountPolicy.Question(org.w3c.dom.Element e)
Construct a question by parsing its DOM representation. |
|
LighthouseAccountPolicy.Question(java.lang.String question)
Construct a question given its question text, automatically generating a new question id. |
|
LighthouseAccountPolicy.Question(java.lang.String id,
java.lang.String question)
Construct a new question with a predefine id. |
Method Summary | |
protected void |
generateId()
Generate a unique question id if there isn't one yet. |
static java.lang.String |
generateQuestionId()
Generate a unique id string for a Question. |
java.lang.String |
getElementName()
Return the element name. |
java.lang.String |
getId()
Get the question id. |
java.lang.String |
getQuestion()
Get the question text. |
GenericObject |
getView()
Return the view representation - a generic object with attributes: id question name |
void |
parseXml(org.w3c.dom.Element e)
Parse the DOM representation of a question, filling out the associated fields. |
static java.util.List |
parseXmlList(org.w3c.dom.Element e)
Builds an ArrayList of Question objects by parsing the XML representation of a Question list. |
void |
setQuestion(java.lang.String q)
Change the question text, automatically generating a new question id. |
void |
toXml(java.lang.StringBuffer b,
int indent)
Serialize the question to an XML buffer. |
Methods inherited from class com.waveset.util.AbstractXmlObject |
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String ELEMENT
Constructor Detail |
public LighthouseAccountPolicy.Question(java.lang.String id, java.lang.String question)
public LighthouseAccountPolicy.Question(org.w3c.dom.Element e)
public LighthouseAccountPolicy.Question(java.lang.String question)
Method Detail |
public java.lang.String getElementName()
AbstractXmlObject
getElementName
in interface XmlObject
getElementName
in class AbstractXmlObject
public java.lang.String getId()
public java.lang.String getQuestion()
public void setQuestion(java.lang.String q)
protected void generateId()
public static java.lang.String generateQuestionId()
public void toXml(java.lang.StringBuffer b, int indent)
toXml
in interface XmlObject
toXml
in class AbstractXmlObject
public GenericObject getView()
public void parseXml(org.w3c.dom.Element e)
public static java.util.List parseXmlList(org.w3c.dom.Element e) throws WavesetException
The provided element is expected to be the wrapper elements, its
name is unimportant. We extract any
WavesetException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |