java.lang.Object
org.apache.wicket.request.resource.AbstractResource
org.apache.wicket.request.resource.DynamicImageResource
org.apache.wicket.extensions.markup.html.captcha.CaptchaImageResource
All Implemented Interfaces:
Serializable, org.apache.wicket.request.resource.IResource, org.apache.wicket.util.io.IClusterable

public class CaptchaImageResource extends org.apache.wicket.request.resource.DynamicImageResource
Generates a captcha image.
Author:
Joshua Perlow
See Also:
  • Nested Class Summary

    Nested classes/interfaces inherited from class org.apache.wicket.request.resource.AbstractResource

    org.apache.wicket.request.resource.AbstractResource.ContentRangeType, org.apache.wicket.request.resource.AbstractResource.ResourceResponse, org.apache.wicket.request.resource.AbstractResource.WriteCallback

    Nested classes/interfaces inherited from interface org.apache.wicket.request.resource.IResource

    org.apache.wicket.request.resource.IResource.Attributes
  • Field Summary

    Fields inherited from class org.apache.wicket.request.resource.AbstractResource

    CONTENT_DISPOSITION_HEADER_NAME, CONTENT_RANGE_ENDBYTE, CONTENT_RANGE_STARTBYTE, INTERNAL_HEADERS
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct.
    Construct.
    CaptchaImageResource(String challengeId, int fontSize, int margin)
    Construct.
    CaptchaImageResource(org.apache.wicket.model.IModel<String> challengeId)
    Construct.
    CaptchaImageResource(org.apache.wicket.model.IModel<String> challengeId, int fontSize, int margin)
    Construct.
  • Method Summary

    Modifier and Type
    Method
    Description
    final String
    Gets the id for the challenge.
    final org.apache.wicket.model.IModel<String>
    Gets the id for the challenge
    protected final byte[]
    getImageData(org.apache.wicket.request.resource.IResource.Attributes attributes)
     
    final void
    Causes the image to be redrawn the next time its requested.
    protected Random
     
    protected byte[]
    Renders this image

    Methods inherited from class org.apache.wicket.request.resource.DynamicImageResource

    configureResponse, getFormat, newResourceResponse, setFormat, setLastModifiedTime, toImageData

    Methods inherited from class org.apache.wicket.request.resource.AbstractResource

    configureCache, getCachingStrategy, respond, setRequestMetaData, setRequestRangeMetaData, setResponseContentRangeHeaderFields, setResponseHeaders

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CaptchaImageResource

      Construct.
    • CaptchaImageResource

      public CaptchaImageResource(String challengeId)
      Construct.
      Parameters:
      challengeId - The id of the challenge
    • CaptchaImageResource

      public CaptchaImageResource(org.apache.wicket.model.IModel<String> challengeId)
      Construct.
      Parameters:
      challengeId - The id of the challenge
    • CaptchaImageResource

      public CaptchaImageResource(org.apache.wicket.model.IModel<String> challengeId, int fontSize, int margin)
      Construct.
      Parameters:
      challengeId - The id of the challenge
      fontSize - The font size
      margin - The image's margin
    • CaptchaImageResource

      public CaptchaImageResource(String challengeId, int fontSize, int margin)
      Construct.
      Parameters:
      challengeId - The id of the challenge
      fontSize - The font size
      margin - The image's margin
  • Method Details

    • newRandomNumberGenerator

    • getChallengeId

      public final String getChallengeId()
      Gets the id for the challenge.
      Returns:
      The id for the challenge
    • getChallengeIdModel

      public final org.apache.wicket.model.IModel<String> getChallengeIdModel()
      Gets the id for the challenge
      Returns:
      The id for the challenge
    • invalidate

      public final void invalidate()
      Causes the image to be redrawn the next time its requested.
    • getImageData

      protected final byte[] getImageData(org.apache.wicket.request.resource.IResource.Attributes attributes)
      Specified by:
      getImageData in class org.apache.wicket.request.resource.DynamicImageResource
    • render

      protected byte[] render()
      Renders this image
      Returns:
      The image data