Class TranscodingRule
java.lang.Object
net.shibboleth.idp.attribute.transcoding.TranscodingRule
Wrapper around a
Map representing a rule for transcoding, used to
detect and load the rules at runtime from a Spring context.-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionTranscodingRule(Map<String, Object> map) Constructor.TranscodingRule(Properties properties) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionstatic TranscodingRulefromResource(Resource resource) Build a new rule from a property set resource.<T> TGet the value of a property key in the rule.Get the descriptions to attach to anyIdPAttributeobjects created by this transcoder.Get the display names to attach to anyIdPAttributeobjects created by this transcoder.getMap()Access the underlying mapping rule.<T> TgetOrDefault(String key, Class<T> type, T defValue) Get the value of a property key in the rule or a default value if no property exists.Process any properties that start withAttributeTranscoderRegistry.PROP_DESCRIPTIONand create a Locale map around them.Process any properties that start withAttributeTranscoderRegistry.PROP_DISPLAY_NAMEand create a Locale map around them.
-
Field Details
-
rule
Underlying map containing the rule. -
displayNames
Map of locale-specific display names. -
descriptions
Map of locale-specific descriptions.
-
-
Constructor Details
-
TranscodingRule
Constructor.- Parameters:
map- a map containing the ruleThe rule MUST contain at least:
-
AttributeTranscoderRegistry.PROP_ID- internal attribute ID to map to/from -
AttributeTranscoderRegistry.PROP_TRANSCODER-AttributeTranscoderinstance supporting the type
-
-
TranscodingRule
Constructor.- Parameters:
properties- a property set to initialize the mapThe rule MUST contain at least:
-
AttributeTranscoderRegistry.PROP_ID- internal attribute ID to map to/from -
AttributeTranscoderRegistry.PROP_TRANSCODER-AttributeTranscoderclass name
-
-
-
Method Details
-
getMap
Access the underlying mapping rule.- Returns:
- the map representing the rule
-
get
Get the value of a property key in the rule.- Type Parameters:
T- type of property value- Parameters:
key- key of propertytype- class type of property- Returns:
- the mapped value, or null
-
getOrDefault
@Nullable public <T> T getOrDefault(@Nonnull @NotEmpty String key, @Nonnull Class<T> type, @Nullable T defValue) Get the value of a property key in the rule or a default value if no property exists.- Type Parameters:
T- type of property value- Parameters:
key- key of propertytype- class type of propertydefValue- default value- Returns:
- the mapped value, or the default
-
getDisplayNames
Get the display names to attach to anyIdPAttributeobjects created by this transcoder.- Returns:
- map of locale-based names
-
getDescriptions
Get the descriptions to attach to anyIdPAttributeobjects created by this transcoder.- Returns:
- map of locale-based descriptions
-
processDisplayNames
Process any properties that start withAttributeTranscoderRegistry.PROP_DISPLAY_NAMEand create a Locale map around them.- Returns:
- the map of display names
-
processDescriptions
Process any properties that start withAttributeTranscoderRegistry.PROP_DESCRIPTIONand create a Locale map around them.- Returns:
- the map of descriptions
-