Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Seam Core JSF2 2.3.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.jboss.seam.captcha
Class Captcha

    java.lang.Object
      org.jboss.seam.captcha.Captcha

All Implemented Interfaces:
  Serializable

    @Name(value="org.jboss.seam.captcha.captcha")
    @Scope(value=SESSION)
    @Install(precedence=0)
    @BypassInterceptors
    public class Captcha

extends Object
implements Serializable

Default CAPTCHA algorithm, a simple addition problem. May be extended and customized.

Author:
  Gavin King
See Also:
  Serialized Form

Constructor Summary
`Captcha()`

Method Summary
`protected String` | `getChallenge()` Get the challenge question
`protected Color` | `getChallengeBackgroundColor()` May be overridden by subclasses
`protected int` | `getChallengeImageWidth()` May be overridden by subclasses
`protected Color` | `getChallengeTextColor()` May be overridden by subclasses
`String` | `getResponse()`
`void` | `init()` Initialize the challenge and correct response.
`static Captcha` | `instance()`
`BufferedImage` | `renderChallenge()` Render the challenge question as an image.
`protected void` | `setChallenge(String challenge)` Set the challenge question
`protected void` | `setCorrectResponse(String correctResponse)` Set the correct response
`void` | `setResponse(String input)`
`boolean` | `validateResponse(String response)` Validate that the entered response is the correct response

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### Captcha

    public Captcha()

Method Detail

### init

    @Create
    public void init()

  Initialize the challenge and correct response. May be overridden and customized by a subclass.

### setChallenge

    protected void setChallenge(String challenge)

  Set the challenge question

### getChallenge

    protected String getChallenge()

  Get the challenge question

### setCorrectResponse

    protected void setCorrectResponse(String correctResponse)

  Set the correct response

### validateResponse

    public boolean validateResponse(String response)

  Validate that the entered response is the correct response

### getResponse

    @CaptchaResponse
    public String getResponse()

### setResponse

    public void setResponse(String input)

### renderChallenge

    public BufferedImage renderChallenge()

  Render the challenge question as an image. May be overridden by subclasses to achieve a stronger CAPTCHA.

### getChallengeImageWidth

    protected int getChallengeImageWidth()

  May be overridden by subclasses

  Returns:
    the width, in pixels, of the challenge question

### getChallengeBackgroundColor

    protected Color getChallengeBackgroundColor()

  May be overridden by subclasses

  Returns:
    the background color of the challenge image

### getChallengeTextColor

    protected Color getChallengeTextColor()

  May be overridden by subclasses

  Returns:
    @return the foreground color of the challenge image

### instance

    public static Captcha instance()

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| Seam Core JSF2 2.3.0.Final
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012 Seam Framework. All Rights Reserved.