Package net.shibboleth.idp.ui.helper
Class AttributeHelper
- All Implemented Interfaces:
Component,DestructableComponent,IdentifiableComponent,IdentifiedComponent,InitializableComponent
Class to help Attribute Extraction in views.
-
Field Summary
FieldsModifier and TypeFieldDescriptionHow to get the AttributeContext we are looking at.private final org.slf4j.LoggerLogger. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFirstAttributeDisplayValue(ProfileRequestContext prc, String attributeName) Return the first (filtered) attribute Value from the attribute of that name as a Display String.getFirstAttributeDisplayValue(ProfileRequestContext prc, String attributeName, String defaultValue) Return the first (filtered) attribute Value from the attribute of that name as a Display String.getFirstAttributeValue(ProfileRequestContext prc, String attributeName) Return the first (filtered) attribute Value from the attribute of that name as anIdPAttributeValue.getFirstUnfilteredAttributeDisplayValue(ProfileRequestContext prc, String attributeName) Return the first (unfiltered) attribute Value from the attribute of that name as a Display String.getFirstUnfilteredAttributeDisplayValue(ProfileRequestContext prc, String attributeName, String defaultValue) Return the first (unfiltered) attribute Value from the attribute of that name as a Display String.getFirstUnfilteredAttributeValue(ProfileRequestContext prc, String attributeName) Return the first (unfiltered) attribute Value from the attribute of that name as anIdPAttributeValue.private IdPAttributeValuegetFirstValue(IdPAttribute attribute) Helper method to get the first attribute name from the attribute.voidSet the way to get theAttributeContext.Methods inherited from class net.shibboleth.shared.component.AbstractIdentifiableInitializableComponent
setIdMethods inherited from class net.shibboleth.shared.component.AbstractIdentifiedInitializableComponent
doInitialize, ensureId, getId, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentExceptionMethods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent
checkComponentActive, checkSetterPreconditions, destroy, doDestroy, initialize, isDestroyed, isInitializedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.shibboleth.shared.component.IdentifiedComponent
getId
-
Field Details
-
attributeContextStrategy
How to get the AttributeContext we are looking at. -
log
@Nonnull private final org.slf4j.Logger logLogger.
-
-
Constructor Details
-
AttributeHelper
public AttributeHelper()
-
-
Method Details
-
setAttributeContextStrategy
public void setAttributeContextStrategy(@Nonnull Function<ProfileRequestContext, AttributeContext> strategy) Set the way to get theAttributeContext.- Parameters:
strategy- the strategy to use
-
getFirstAttributeValue
@Nullable public IdPAttributeValue getFirstAttributeValue(@Nonnull ProfileRequestContext prc, @Nonnull @NotEmpty String attributeName) Return the first (filtered) attribute Value from the attribute of that name as anIdPAttributeValue.- Parameters:
prc- The ProfileRequestContextattributeName- The attribute name to look up- Returns:
- The attribute value or null
-
getFirstAttributeDisplayValue
@Nonnull public String getFirstAttributeDisplayValue(@Nonnull ProfileRequestContext prc, @Nonnull @NotEmpty String attributeName, @Nonnull String defaultValue) Return the first (filtered) attribute Value from the attribute of that name as a Display String.- Parameters:
prc- The ProfileRequestContextattributeName- The attribute name to look updefaultValue- What to return if nothing found.- Returns:
- The default value or the attribute value
-
getFirstAttributeDisplayValue
@Nonnull public String getFirstAttributeDisplayValue(@Nonnull ProfileRequestContext prc, @Nonnull @NotEmpty String attributeName) Return the first (filtered) attribute Value from the attribute of that name as a Display String.- Parameters:
prc- The ProfileRequestContextattributeName- The attribute name to look up- Returns:
- The attribute value or ""
-
getFirstUnfilteredAttributeValue
@Nullable public IdPAttributeValue getFirstUnfilteredAttributeValue(@Nonnull ProfileRequestContext prc, @Nonnull @NotEmpty String attributeName) Return the first (unfiltered) attribute Value from the attribute of that name as anIdPAttributeValue.- Parameters:
prc- The ProfileRequestContextattributeName- The attribute name to look up- Returns:
- The attribute value or null
-
getFirstUnfilteredAttributeDisplayValue
@Nonnull public String getFirstUnfilteredAttributeDisplayValue(@Nonnull ProfileRequestContext prc, @Nonnull @NotEmpty String attributeName, @Nonnull String defaultValue) Return the first (unfiltered) attribute Value from the attribute of that name as a Display String.- Parameters:
prc- The ProfileRequestContextattributeName- The attribute name to look updefaultValue- What to return if nothing found- Returns:
- The default value or the attribute value
-
getFirstUnfilteredAttributeDisplayValue
@Nonnull public String getFirstUnfilteredAttributeDisplayValue(@Nonnull ProfileRequestContext prc, @Nonnull @NotEmpty String attributeName) Return the first (unfiltered) attribute Value from the attribute of that name as a Display String.- Parameters:
prc- The ProfileRequestContextattributeName- The attribute name to look up- Returns:
- The attribute value or ""
-
getFirstValue
Helper method to get the first attribute name from the attribute.- Parameters:
attribute- the Attribute or null if there wasn't one- Returns:
- the first attribute value or null
-