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(AttributeTranscoderRegistry, IdPAttribute)
returns the information selected for
the attribute from the transcoder.
This function defaults to returning the attribute ID if no information is selected from the attribute
for the desired locales.-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Map<IdPAttribute,
Map<Locale, String>> Cache of already looked up values.private final List<Locale.LanguageRange>
The tags for the fallback languages.private final List<Locale.LanguageRange>
The range of locales from the request.How to do the lookup. -
Constructor Summary
ConstructorsConstructorDescriptionAbstractAttributeDisplayFunction
(javax.servlet.http.HttpServletRequest request, List<String> defaultLanguages, ReloadableService<AttributeTranscoderRegistry> transcoderService) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionapply
(IdPAttribute input) getDisplayInfo
(AttributeTranscoderRegistry registry, IdPAttribute attribute) 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. -
cachedInfo
Cache of already looked up values. -
transcoder
How to do the lookup.
-
-
Constructor Details
-
AbstractAttributeDisplayFunction
public AbstractAttributeDisplayFunction(@Nonnull javax.servlet.http.HttpServletRequest request, @Nullable List<String> defaultLanguages, ReloadableService<AttributeTranscoderRegistry> transcoderService) Constructor.- Parameters:
request
-HttpServletRequest
used to get preferred languagesdefaultLanguages
- list of fallback languages in order of decreasing preferencetranscoderService
- the attribute transcoder service
-
-
Method Details
-
apply
- Specified by:
apply
in interfaceFunction<IdPAttribute,
String>
-
getDisplayInfo
@Nonnull protected abstract Map<Locale,String> getDisplayInfo(@Nonnull AttributeTranscoderRegistry registry, @Nonnull IdPAttribute attribute) Get the information to be displayed from the attribute.- Parameters:
registry
- theAttributeTranscoderRegistry
to ask.attribute
- the attribute to consider- Returns:
- the map of locale dependent information to be displayed
-