Class AuthenticationExceptionToLabelConverter
- java.lang.Object
-
- de.hybris.platform.cockpit.security.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 theAuthenticationExceptionto a localized label key to be displayed on the login form. Use configurable authenticationExceptionMessageMapping to match labels with authentication exception class.
-
-
Constructor Summary
Constructors Constructor Description AuthenticationExceptionToLabelConverter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.zkoss.zul.Labelconvert(org.springframework.security.core.AuthenticationException source)Converts the source object, creating a new instance of the destination typeorg.zkoss.zul.Labelconvert(org.springframework.security.core.AuthenticationException source, org.zkoss.zul.Label prototype)Convert the source object by filling the prototypeprotected java.util.Map<java.lang.Class,java.lang.String>getAuthenticationExceptionMessageMapping()protected java.lang.StringgetDefaultLabel()protected java.util.List<java.lang.Class>getWarningExceptions()voidsetAuthenticationExceptionMessageMapping(java.util.Map<java.lang.Class,java.lang.String> authenticationExceptionMessageMapping)voidsetDefaultLabel(java.lang.String defaultLabel)voidsetWarningExceptions(java.util.List<java.lang.Class> warningExceptions)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface de.hybris.platform.servicelayer.dto.converter.Converter
convertAll, convertAllIgnoreExceptions, getLogger
-
-
-
-
Method Detail
-
convert
public org.zkoss.zul.Label convert(org.springframework.security.core.AuthenticationException source) throws ConversionExceptionDescription copied from interface:ConverterConverts the source object, creating a new instance of the destination type- Specified by:
convertin interfaceConverter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>- Specified by:
convertin interfaceorg.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 ConversionExceptionDescription copied from interface:ConverterConvert the source object by filling the prototype- Specified by:
convertin interfaceConverter<org.springframework.security.core.AuthenticationException,org.zkoss.zul.Label>- Parameters:
source- the source objectprototype- 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
-
-