Class AbstractAttributeDisplayFunction
java.lang.Object
net.shibboleth.idp.consent.logic.impl.AbstractAttributeDisplayFunction
- All Implemented Interfaces:
Function<IdPAttribute,String>
- Direct Known Subclasses:
AttributeDisplayDescriptionFunction
,AttributeDisplayNameFunction
public abstract class AbstractAttributeDisplayFunction extends Object implements Function<IdPAttribute,String>
Abstract Function which returns
Locale
-aware information about an attribute. The abstract method
getDisplayInfo(IdPAttribute)
returns the information selected from the attribute. This function defaults to
returning the attribute ID if no information is selected from the attribute for the desired locales.-
Field Summary
Fields Modifier and Type Field Description private List<Locale.LanguageRange>
defaultLanguageRange
The tags for the fallback languages.private List<Locale.LanguageRange>
languageRange
The range of locales from the request. -
Constructor Summary
Constructors Constructor Description AbstractAttributeDisplayFunction(javax.servlet.http.HttpServletRequest request, List<String> defaultLanguages)
Constructor. -
Method Summary
Modifier and Type Method Description String
apply(IdPAttribute input)
protected abstract Map<Locale,String>
getDisplayInfo(IdPAttribute input)
Get the information to be displayed from the attribute.
-
Field Details
-
languageRange
The range of locales from the request. -
defaultLanguageRange
The tags for the fallback languages.
-
-
Constructor Details
-
AbstractAttributeDisplayFunction
public AbstractAttributeDisplayFunction(@Nonnull javax.servlet.http.HttpServletRequest request, @Nullable List<String> defaultLanguages)Constructor.- Parameters:
request
-HttpServletRequest
used to get preferred languagesdefaultLanguages
- list of fallback languages in order of decreasing preference
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<IdPAttribute,String>
-
getDisplayInfo
Get the information to be displayed from the attribute.- Parameters:
input
- the attribute to consider- Returns:
- the map of locale dependent information to be displayed
-