Class AbstractAttributeDisplayFunction
- java.lang.Object
-
- net.shibboleth.idp.consent.logic.impl.AbstractAttributeDisplayFunction
-
- Direct Known Subclasses:
AttributeDisplayDescriptionFunction,AttributeDisplayNameFunction
public abstract class AbstractAttributeDisplayFunction extends Object implements Function<net.shibboleth.idp.attribute.IdPAttribute,String>
Abstract Function which returnsLocale-aware information about an attribute. The abstract methodgetDisplayInfo(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>defaultLanguageRangeThe tags for the fallback languages.private List<Locale.LanguageRange>languageRangeThe range of locales from the request.
-
Constructor Summary
Constructors Constructor Description AbstractAttributeDisplayFunction(javax.servlet.http.HttpServletRequest request, List<String> defaultLanguages)Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description Stringapply(net.shibboleth.idp.attribute.IdPAttribute input)protected abstract Map<Locale,String>getDisplayInfo(net.shibboleth.idp.attribute.IdPAttribute input)Get the information to be displayed from the attribute.
-
-
-
Field Detail
-
languageRange
@Nonnull @Unmodifiable private final List<Locale.LanguageRange> languageRange
The range of locales from the request.
-
defaultLanguageRange
@Nonnull @Unmodifiable private final List<Locale.LanguageRange> defaultLanguageRange
The tags for the fallback languages.
-
-
Constructor Detail
-
AbstractAttributeDisplayFunction
public AbstractAttributeDisplayFunction(@Nonnull javax.servlet.http.HttpServletRequest request, @Nullable List<String> defaultLanguages)Constructor.- Parameters:
request-HttpServletRequestused to get preferred languagesdefaultLanguages- list of fallback languages in order of decreasing preference
-
-
Method Detail
-
apply
@Nullable public String apply(@Nullable net.shibboleth.idp.attribute.IdPAttribute input)
-
getDisplayInfo
@Nonnull protected abstract Map<Locale,String> getDisplayInfo(@Nonnull net.shibboleth.idp.attribute.IdPAttribute input)
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
-
-