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 AbstractTypedAnswer<T>

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.component.survey.model.AbstractTypedAnswer<T>
Type Parameters:
T - the type of the AbstractTypedAnswer<T>
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
OpenQuestionAnswer, QuestionGroupAnswer, SelectQuestionAnswer

@Entity
public abstract class AbstractTypedAnswer<T>
extends AbstractBasicEntity

The base-class to derive an answer from.

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

Constructor Summary
AbstractTypedAnswer()
           
 
Method Summary
 AbstractQuestion getQuestion(org.hibernate.Session s)
          Returns the AbstractQuestion the AbstractTypedAnswer<T> belongs to.
 java.lang.Long getQuestionId()
          Returns the id of the AbstractQuestion this AbstractTypedAnswer<T> belongs to.
 AnswerValidationError getValidationError()
          Returns the validationError.
abstract  T getValue()
          Returns the value of the AbstractTypedAnswer<T>.
 boolean isValid()
          Returns true if the AbstractTypedAnswer<T> is valid, false otherwise.
protected  void setQuestionId(java.lang.Long questId)
          Sets the id of the AbstractQuestion this AbstractTypedAnswer<T> belongs to.
protected  void setValid(boolean valid)
          Sets the valid-state for the AbstractTypedAnswear.
protected  void setValidationError(AnswerValidationError error)
          Sets the validationError.
 
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

AbstractTypedAnswer

public AbstractTypedAnswer()
Method Detail

setQuestionId

protected final void setQuestionId(java.lang.Long questId)
Sets the id of the AbstractQuestion this AbstractTypedAnswer<T> belongs to.

Parameters:
questId - the AbstractQuestion to set

getQuestionId

public final java.lang.Long getQuestionId()
Returns the id of the AbstractQuestion this AbstractTypedAnswer<T> belongs to.

Returns:
the AbstractQuestion

getQuestion

public final AbstractQuestion getQuestion(org.hibernate.Session s)
Returns the AbstractQuestion the AbstractTypedAnswer<T> belongs to.

Parameters:
s - the hibernateTM-Session
Returns:
the AbstractQuestion the AbstractTypedAnswer<T> belongs to if a AbstractQuestion could be loaded, null otherwise

setValid

protected final void setValid(boolean valid)
Sets the valid-state for the AbstractTypedAnswear.

Parameters:
valid - the value to be set

isValid

public final boolean isValid()
Returns true if the AbstractTypedAnswer<T> is valid, false otherwise.

Returns:
true if the AbstractTypedAnswer<T> is valid, false otherwise

setValidationError

protected final void setValidationError(AnswerValidationError error)
Sets the validationError.

Parameters:
error - the AnswerValidationError to set

getValidationError

public final AnswerValidationError getValidationError()
Returns the validationError.

Returns:
the validationError

getValue

public abstract T getValue()
Returns the value of the AbstractTypedAnswer<T>.

Returns:
the value