Class WrappedScriptCaptcha

  • All Implemented Interfaces:
    Captcha

    public class WrappedScriptCaptcha
    extends org.xwiki.script.internal.safe.AbstractSafeObject<Captcha>
    implements Captcha
    Wrap a Captcha implementation for script API access.
    Since:
    10.8RC1
    Version:
    $Id: 43d66a7e00d0c0eba1ae4ab4648fae7ed992c77c $
    • Constructor Detail

      • WrappedScriptCaptcha

        public WrappedScriptCaptcha​(Captcha captcha,
                                    org.xwiki.script.internal.safe.ScriptSafeProvider<Captcha> safeProvider,
                                    org.slf4j.Logger logger)
        Parameters:
        captcha - the Captcha to wrap for Script API access
        safeProvider - the provider making the conversion to the safe version
        logger - the logging component
    • Method Detail

      • getLogger

        protected org.slf4j.Logger getLogger()
      • display

        public String display​(Map<String,​Object> parameters)
        Specified by:
        display in interface Captcha
        Parameters:
        parameters - the CAPTCHA override parameters
        Returns:
        the displayed wrapped CAPTCHA or null in case of an exception
        See Also:
        Captcha.display(Map)
      • isValid

        public boolean isValid()
        Specified by:
        isValid in interface Captcha
        Returns:
        true if the answer is valid; false otherwise or if an exception occurs
        See Also:
        Captcha.isValid()
      • isValid

        public boolean isValid​(Map<String,​Object> parameters)
        Specified by:
        isValid in interface Captcha
        Parameters:
        parameters - the CAPTCHA override parameters
        Returns:
        true if the answer is valid; false otherwise or if an exception occurs
        See Also:
        Captcha.isValid(Map)