Class 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:
    Serialized Form
    • 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 Detail

      • 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 Detail

      • 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<StringgetChallengeIdModel()
        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