View Javadoc

1   /*
2    * JCaptcha, the open source java framework for captcha definition and integration
3    * Copyright (c)  2007 jcaptcha.net. All Rights Reserved.
4    * See the LICENSE.txt file distributed with this package.
5    */
6   
7   package com.octo.captcha.engine;
8   
9   import com.octo.captcha.Captcha;
10  import com.octo.captcha.CaptchaFactory;
11  import com.octo.captcha.MockCaptcha;
12  import com.octo.captcha.engine.CaptchaEngineException;
13  
14  import java.util.Locale;
15  
16  /***
17   * <p><ul><li></li></ul></p>
18   *
19   * @author <a href="mailto:mag@jcaptcha.net">Marc-Antoine Garrigue</a>
20   * @version 1.0
21   */
22  public class MockCaptchaEngine implements com.octo.captcha.engine.CaptchaEngine {
23      /***
24       * This return a new captcha. It may be used directly.
25       *
26       * @return a new Captcha
27       */
28      public Captcha getNextCaptcha() {
29          return new MockCaptcha(null);
30      }
31  
32      /***
33       * This return a new captcha. It may be used directly.
34       *
35       * @param locale the desired locale
36       *
37       * @return a new Captcha
38       */
39      public Captcha getNextCaptcha(Locale locale) {
40          return new MockCaptcha(locale);
41      }
42  
43      /***
44       * @return captcha factories used by this engine
45       */
46      public CaptchaFactory[] getFactories() {
47          return new CaptchaFactory[0];
48      }
49  
50      /***
51       * @param factories new captcha factories for this engine
52       *
53       * @throws com.octo.captcha.engine.CaptchaEngineException
54       *          if the factories are invalid for this engine
55       */
56      public void setFactories(CaptchaFactory[] factories) throws CaptchaEngineException {
57  
58      }
59  }