com.octo.captcha.engine.image
Class ImageCaptchaEngine

java.lang.Object
  extended by com.octo.captcha.engine.image.ImageCaptchaEngine
All Implemented Interfaces:
CaptchaEngine
Direct Known Subclasses:
DefaultImageCaptchaEngine, ListImageCaptchaEngine

public abstract class ImageCaptchaEngine
extends java.lang.Object
implements CaptchaEngine

Description: abstract base class for ImageCaptcha engines

.


Field Summary
protected  java.util.List factories
           
protected  java.util.Random myRandom
           
 
Constructor Summary
ImageCaptchaEngine()
           
 
Method Summary
protected  void checkNotNullOrEmpty(CaptchaFactory[] factories)
           
 CaptchaFactory[] getFactories()
           
 ImageCaptchaFactory getImageCaptchaFactory()
          This method build a ImageCaptchaFactory.
 Captcha getNextCaptcha()
          This return a new captcha.
 Captcha getNextCaptcha(java.util.Locale locale)
          This return a new captcha.
 ImageCaptcha getNextImageCaptcha()
          This method use an object parameter to build a CaptchaFactory.
 ImageCaptcha getNextImageCaptcha(java.util.Locale locale)
          This return a new captcha.
 void setFactories(CaptchaFactory[] factories)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

factories

protected java.util.List factories

myRandom

protected java.util.Random myRandom
Constructor Detail

ImageCaptchaEngine

public ImageCaptchaEngine()
Method Detail

getImageCaptchaFactory

public ImageCaptchaFactory getImageCaptchaFactory()
This method build a ImageCaptchaFactory.

Returns:
a CaptchaFactory

getNextImageCaptcha

public final ImageCaptcha getNextImageCaptcha()
This method use an object parameter to build a CaptchaFactory.

Returns:
a CaptchaFactory

getNextImageCaptcha

public ImageCaptcha getNextImageCaptcha(java.util.Locale locale)
This return a new captcha. It may be used directly.

Parameters:
locale - the desired locale
Returns:
a new Captcha

getNextCaptcha

public final Captcha getNextCaptcha()
Description copied from interface: CaptchaEngine
This return a new captcha. It may be used directly.

Specified by:
getNextCaptcha in interface CaptchaEngine
Returns:
a new Captcha

getNextCaptcha

public Captcha getNextCaptcha(java.util.Locale locale)
This return a new captcha. It may be used directly.

Specified by:
getNextCaptcha in interface CaptchaEngine
Parameters:
locale - the desired locale
Returns:
a new Captcha

getFactories

public CaptchaFactory[] getFactories()
Specified by:
getFactories in interface CaptchaEngine
Returns:
captcha factories used by this engine

setFactories

public void setFactories(CaptchaFactory[] factories)
                  throws CaptchaEngineException
Specified by:
setFactories in interface CaptchaEngine
Parameters:
factories - new captcha factories for this engine
Throws:
CaptchaEngineException - if the factories are invalid for this engine

checkNotNullOrEmpty

protected void checkNotNullOrEmpty(CaptchaFactory[] factories)


Copyright 2003-2009 JCaptcha. All Rights Reserved.