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
Enum AnswerValidationError

java.lang.Object
  extended by java.lang.Enum<AnswerValidationError>
      extended by org.torweg.pulse.component.survey.model.AnswerValidationError
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<AnswerValidationError>

public enum AnswerValidationError
extends java.lang.Enum<AnswerValidationError>

Error-Codes of the AbstractTypedAnswer<?> (for usage in XSL). The AnswerValidationError will be set for the AbstractTypedAnswer<?> during validation by the validating AbstractQuestion.

Version:
$Revision: 1586 $
Author:
Daniel Dietz
See Also:
AbstractQuestion.isValid(AbstractTypedAnswer)

Enum Constant Summary
BLANK_IS_NOT_ALLOWED
          This error occurs if the actual {@code AbstractTypedAnswer
QUESTION_DOES_NOT_MATCH
          This error occurs if the actual questionId of the {@code AbstractTypedAnswer
REGEX_MATCH_ERROR
          This error occurs if the value of the actual {@code AbstractTypedAnswer
VALUE_COUNT_ERROR
          This error occurs if the value of the actual {@code AbstractTypedAnswer
WRONG_TYPE
          This error occurs if the actual class of the {@code AbstractTypedAnswer
 
Method Summary
static AnswerValidationError valueOf(java.lang.String name)
          Returns the enum constant of this type with the specified name.
static AnswerValidationError[] values()
          Returns an array containing the constants of this enum type, in the order they're declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

WRONG_TYPE

public static final AnswerValidationError WRONG_TYPE
This error occurs if the actual class of the AbstractTypedAnswer<?> passed to a AbstractQuestion for validation the does not correspond to the expected class.


QUESTION_DOES_NOT_MATCH

public static final AnswerValidationError QUESTION_DOES_NOT_MATCH
This error occurs if the actual questionId of the AbstractTypedAnswer<?> passed to a AbstractQuestion for validation the does not correspond to the id of the validating AbstractQuestion.


BLANK_IS_NOT_ALLOWED

public static final AnswerValidationError BLANK_IS_NOT_ALLOWED
This error occurs if the actual AbstractTypedAnswer<?> passed to a AbstractQuestion for validation is "blank", while the setting for AbstractQuestion.isAllowBlank is true.

With OpenQuestions this error occurs if the String to be set as value for the AbstractTypedAnswer<?>:

With SelectQuestions this error occurs if the List<String> to be set as value for the AbstractTypedAnswer<?>:

With QuestionGroups this error occurs if the List<AbstractTypedAnswer<?>> to be set as value for the AbstractTypedAnswer<?>:


REGEX_MATCH_ERROR

public static final AnswerValidationError REGEX_MATCH_ERROR
This error occurs if the value of the actual AbstractTypedAnswer<?> passed to a OpenQuestion for validation does not match a regular expression the OpenQuestion might have set.

See Also:
OpenQuestion.regexpression

VALUE_COUNT_ERROR

public static final AnswerValidationError VALUE_COUNT_ERROR
This error occurs if the value of the actual AbstractTypedAnswer<?> passed to a SelectQuestion for validation does have an invalid number of values.

Method Detail

values

public static final AnswerValidationError[] values()
Returns an array containing the constants of this enum type, in the order they're declared. This method may be used to iterate over the constants as follows:
for(AnswerValidationError c : AnswerValidationError.values())
        System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they're declared

valueOf

public static AnswerValidationError valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
java.lang.IllegalArgumentException - if this enum type has no constant with the specified name