pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.survey.model
Class AbstractQuestion

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.survey.model.AbstractQuestion
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
OpenQuestion, QuestionGroup, SelectQuestion

@Entity
public abstract class AbstractQuestion
extends AbstractBasicEntity

The base-class to derive a question from.

Version:
$Revision: 1586 $
Author:
Daniel Dietz
See Also:
Serialized Form

Constructor Summary
AbstractQuestion()
           
 
Method Summary
abstract  AbstractTypedAnswer<?> getAnswer(ServiceRequest request)
          Returns the {@code AbstractTypedAnswer<?
 java.lang.String getQuestionText()
          Returns the question text of the AbstractQuestion.
 boolean isAllowBlank()
          Returns the value for allow-blank.
abstract  boolean isValid(AbstractTypedAnswer<?> answer)
          Checks the given {@code AbstractTypedAnswer<?
 void setIsAllowBlank(boolean allow)
          Sets the value for isAllowBlank of the AbstractQuestion.
 void setQuestionText(java.lang.String text)
          Sets the question text for the AbstractQuestion.
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractQuestion

public AbstractQuestion()
Method Detail

setIsAllowBlank

public final void setIsAllowBlank(boolean allow)
Sets the value for isAllowBlank of the AbstractQuestion.

Parameters:
allow - the value to set

isAllowBlank

public final boolean isAllowBlank()
Returns the value for allow-blank.

Returns:
the value for allow-blank

setQuestionText

public final void setQuestionText(java.lang.String text)
Sets the question text for the AbstractQuestion.

Parameters:
text - the question text to set

getQuestionText

public final java.lang.String getQuestionText()
Returns the question text of the AbstractQuestion.

Returns:
the question text

isValid

public abstract boolean isValid(AbstractTypedAnswer<?> answer)
Checks the given AbstractTypedAnswer&lt;?&gt; for validity.

Parameters:
answer - the AbstractTypedAnswer&lt;?&gt; to validate
Returns:
true if the AbstractTypedAnswer&lt;?&gt; is valid, false otherwise

getAnswer

public abstract AbstractTypedAnswer<?> getAnswer(ServiceRequest request)
Returns the AbstractTypedAnswer&lt;? extends Object&gt; for the given ServiceRequest.

Parameters:
request - the ServiceRequest
Returns:
the AbstractTypedAnswer&lt;? extends Object&gt;