com.octo.captcha.text
Class TextCaptcha

java.lang.Object
  extended by com.octo.captcha.text.TextCaptcha
All Implemented Interfaces:
Captcha, java.io.Serializable
Direct Known Subclasses:
MathCaptcha

public abstract class TextCaptcha
extends java.lang.Object
implements Captcha

A text captcha is a captcha with a Text challenge... This class is abstract.

See Also:
Serialized Form

Field Summary
protected  java.lang.String challenge
           
protected  java.lang.String question
           
 
Constructor Summary
protected TextCaptcha(java.lang.String question, java.lang.String challenge)
           
 
Method Summary
 void disposeChallenge()
          Dispose the challenge, once this method is call the getChallenge method will return null.
 java.lang.Object getChallenge()
          Accerssor for the questionned challenge.
 java.lang.String getQuestion()
          Accessor captcha question.
 java.lang.String getTextChallenge()
          Accerssor for the questionned challenge in text format.
 java.lang.Boolean hasGetChalengeBeenCalled()
          This method should return true if the getChalenge method has been called (has been added in order to properly manage the captcha state.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.octo.captcha.Captcha
validateResponse
 

Field Detail

question

protected java.lang.String question

challenge

protected java.lang.String challenge
Constructor Detail

TextCaptcha

protected TextCaptcha(java.lang.String question,
                      java.lang.String challenge)
Method Detail

getQuestion

public java.lang.String getQuestion()
Accessor captcha question.

Specified by:
getQuestion in interface Captcha
Returns:
the question

getChallenge

public java.lang.Object getChallenge()
Accerssor for the questionned challenge.

Specified by:
getChallenge in interface Captcha
Returns:
the challenge (may be an image for image captcha...

getTextChallenge

public java.lang.String getTextChallenge()
Accerssor for the questionned challenge in text format.

Returns:
the challenge

disposeChallenge

public void disposeChallenge()
Dispose the challenge, once this method is call the getChallenge method will return null.
It has been added for technical reasons : a captcha is always used in a two step fashion
First submit the challenge, and then wait until the response arrives.
It had been asked to have a method to dispose the challenge that is no longer used after being dipslayed. So here it is!

Specified by:
disposeChallenge in interface Captcha

hasGetChalengeBeenCalled

public java.lang.Boolean hasGetChalengeBeenCalled()
This method should return true if the getChalenge method has been called (has been added in order to properly manage the captcha state.

Specified by:
hasGetChalengeBeenCalled in interface Captcha
Returns:
true if getChallenge has been called false otherwise.


Copyright 2003-2009 JCaptcha. All Rights Reserved.