Class AuthenticationExceptionToLabelConverter

  • All Implemented Interfaces:
    Converter<org.springframework.security.core.AuthenticationException,​org.zkoss.zul.Label>, org.springframework.core.convert.converter.Converter<org.springframework.security.core.AuthenticationException,​org.zkoss.zul.Label>

    public class AuthenticationExceptionToLabelConverter
    extends java.lang.Object
    implements Converter<org.springframework.security.core.AuthenticationException,​org.zkoss.zul.Label>
    Converts the AuthenticationException to a localized label key to be displayed on the login form. Use configurable authenticationExceptionMessageMapping to match labels with authentication exception class.
    • Constructor Detail

      • AuthenticationExceptionToLabelConverter

        public AuthenticationExceptionToLabelConverter()
    • Method Detail

      • convert

        public org.zkoss.zul.Label convert​(org.springframework.security.core.AuthenticationException source)
                                    throws ConversionException
        Description copied from interface: Converter
        Converts the source object, creating a new instance of the destination type
        Specified by:
        convert in interface Converter<org.springframework.security.core.AuthenticationException,​org.zkoss.zul.Label>
        Specified by:
        convert in interface org.springframework.core.convert.converter.Converter<org.springframework.security.core.AuthenticationException,​org.zkoss.zul.Label>
        Parameters:
        source - the source object
        Returns:
        the converted object
        Throws:
        ConversionException - if an error occurs
      • getDefaultLabel

        protected java.lang.String getDefaultLabel()
      • convert

        public org.zkoss.zul.Label convert​(org.springframework.security.core.AuthenticationException source,
                                           org.zkoss.zul.Label prototype)
                                    throws ConversionException
        Description copied from interface: Converter
        Convert the source object by filling the prototype
        Specified by:
        convert in interface Converter<org.springframework.security.core.AuthenticationException,​org.zkoss.zul.Label>
        Parameters:
        source - the source object
        prototype - the prototype to fill
        Returns:
        the converted object, identical to the prototype
        Throws:
        ConversionException - if an error occurs
      • getAuthenticationExceptionMessageMapping

        protected java.util.Map<java.lang.Class,​java.lang.String> getAuthenticationExceptionMessageMapping()
        Returns:
        the authenticationExceptionMessageMapping
      • setAuthenticationExceptionMessageMapping

        public void setAuthenticationExceptionMessageMapping​(java.util.Map<java.lang.Class,​java.lang.String> authenticationExceptionMessageMapping)
        Parameters:
        authenticationExceptionMessageMapping - the authenticationExceptionMessageMapping to set
      • setDefaultLabel

        public void setDefaultLabel​(java.lang.String defaultLabel)
        Parameters:
        defaultLabel - the defaultLabel to set
      • getWarningExceptions

        protected java.util.List<java.lang.Class> getWarningExceptions()
        Returns:
        the warningExceptions
      • setWarningExceptions

        public void setWarningExceptions​(java.util.List<java.lang.Class> warningExceptions)
        Parameters:
        warningExceptions - the warningExceptions to set