/**
 * Copyright (c) Anton Johansson <antoon.johansson@gmail.com>
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.antonjohansson.vaadin.recaptcha;

import com.antonjohansson.vaadin.recaptcha.shared.RecaptchaState;
import com.vaadin.annotations.JavaScript;
import com.vaadin.ui.AbstractJavaScriptComponent;

/**
 * A Google reCAPTCHA v2 component.
 */
@JavaScript("recaptcha-connector.js")
public class Recaptcha extends AbstractJavaScriptComponent
{
    private static final String DEFAULT_VERIFY_URL = "https://www.google.com/recaptcha/api/siteverify";

    private String secretKey = "";
    private String response = "";
    private String verifyURL = DEFAULT_VERIFY_URL;

    /**
     * Constructs a new {@link Recaptcha}.
     */
    public Recaptcha()
    {
        addFunction("setResponse", arguments ->
        {
            response = arguments.asString();
        });
    }

    public void setSiteKey(String siteKey)
    {
        getState().siteKey = siteKey;
    }

    public void setSecretKey(String secretKey)
    {
        this.secretKey = secretKey;
    }

    public void setVerifyURL(String verifyURL)
    {
        this.verifyURL = verifyURL;
    }

    @Override
    protected RecaptchaState getState()
    {
        return (RecaptchaState) super.getState();
    }

    /**
     * Resets the reCAPTCHA.
     */
    public void reset()
    {
        response = "";
        callFunction("reset");
    }

    /**
     * Gets whether or not this request is verified.
     *
     * @return Returns {@code true} if this request is verified.
     */
    public boolean isVerified()
    {
        RecaptchaVerifier verifier = new RecaptchaVerifier(secretKey, response, verifyURL);
        return verifier.isVerified();
    }
}

@@ -1102,21 +1102,46 @@
 ecretKey
- = %22%22
+;%0A    private String verifyURL
 ;%0A    pr
@@ -1172,38 +1172,487 @@
 %22%22;%0A
+%0A
     
-private String
+/**%0A     * Constructs a new, empty %7B@link Recaptcha%7D with the default verify URL.%0A     */%0A    public Recaptcha()%0A    %7B%0A        this(%22%22, %22%22);%0A    %7D%0A%0A    /**%0A     * Constructs a new %7B@link Recaptcha%7D with the given site key and secret key%0A     * using the default
  verify
+ 
 URL
- =
+.%0A     *%0A     * @param siteKey The public key to use.%0A     * @param secretKey The secret key to use.%0A     */%0A    public Recaptcha(String siteKey, String secretKey)%0A    %7B%0A        this(siteKey, secretKey,
  DEF
@@ -1666,17 +1666,24 @@
 RIFY_URL
+)
 ;
+%0A    %7D
 %0A%0A    /*
@@ -1729,358 +1729,1072 @@
 cha%7D
-.%0A     */%0A    public Recaptcha()%0A    %7B%0A        addFunction(%22setResponse%22, arguments -%3E%0A        %7B%0A            response = arguments.asString();%0A        %7D);%0A    %7D%0A%0A    public void setSiteKey(String siteKey)%0A    %7B%0A        getState().siteKey = siteKey;%0A    %7D%0A%0A    public void setSecretKey(String secretKey)%0A    %7B%0A        this.secretKey = secretKey;%0A    %7D%0A
+ with the given site key, secret key%0A     * and verify URL.%0A     *%0A     * @param siteKey The public key to use.%0A     * @param secretKey The secret key to use.%0A     * @param verifyURL The URL to use when verifying the reCAPTCHA.%0A     */%0A    public Recaptcha(String siteKey, String secretKey, String verifyURL)%0A    %7B%0A        setSiteKey(siteKey);%0A        setSecretKey(secretKey);%0A        setVerifyURL(verifyURL);%0A        addFunction(%22setResponse%22, arguments -%3E%0A        %7B%0A            response = arguments.asString();%0A        %7D);%0A    %7D%0A%0A    /**%0A     * Sets the public key.%0A     *%0A     * @param siteKey The public key to use.%0A     */%0A    public void setSiteKey(String siteKey)%0A    %7B%0A        getState().siteKey = siteKey;%0A    %7D%0A%0A    /**%0A     * Sets the secret key.%0A     *%0A     * @param secretKey The secret key to use.%0A     */%0A    public void setSecretKey(String secretKey)%0A    %7B%0A        this.secretKey = secretKey;%0A    %7D%0A%0A    /**%0A     * Sets the URL to use when verifying the reCAPTCHA.%0A     *%0A     * @param verifyURL The URL to use when verifying the reCAPTCHA.%0A     */
 %0A   

Add constructor overloads and JavaDoc