com.octo.captcha.image
Class ImageCaptcha

java.lang.Object
  extended by com.octo.captcha.image.ImageCaptcha
All Implemented Interfaces:
Captcha, java.io.Serializable
Direct Known Subclasses:
FishEye, Gimpy

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

String question about a BufferedImage challenge. Abstract.

See Also:
Serialized Form

Field Summary
protected  java.awt.image.BufferedImage challenge
           
protected  java.lang.String question
           
 
Constructor Summary
protected ImageCaptcha(java.lang.String question, java.awt.image.BufferedImage 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.awt.image.BufferedImage getImageChallenge()
           
 java.lang.String getQuestion()
          Accessor captcha question
 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 transient java.awt.image.BufferedImage challenge
Constructor Detail

ImageCaptcha

protected ImageCaptcha(java.lang.String question,
                       java.awt.image.BufferedImage challenge)
Method Detail

getQuestion

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

Specified by:
getQuestion in interface Captcha
Returns:
the question

getChallenge

public final java.lang.Object getChallenge()
Description copied from interface: Captcha
Accerssor for the questionned challenge.

Specified by:
getChallenge in interface Captcha
Returns:
the challenge

getImageChallenge

public final java.awt.image.BufferedImage getImageChallenge()
Returns:
the image challenge

disposeChallenge

public final 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.