Package net.shibboleth.idp.attribute.transcoding

# Interface AttributeTranscoder<T>

Type Parameters:
  `T` - the type of object supported

All Superinterfaces:
  `Component`, `InitializableComponent`

All Known Subinterfaces:
  `SAML1AttributeTranscoder<EncodedType>`, `SAML2AttributeTranscoder<EncodedType>`, `SAML2NameIDTranscoder<EncodedType>`

All Known Implementing Classes:
  `AbstractAttributeTranscoder`, `AbstractSAML1AttributeTranscoder`, `AbstractSAML2AttributeTranscoder`, `AbstractSAML2NameIDTranscoder`, `AbstractSAMLAttributeTranscoder`, `SAML1ByteAttributeTranscoder`, `SAML1ScopedStringAttributeTranscoder`, `SAML1StringAttributeTranscoder`, `SAML1XMLObjectAttributeTranscoder`, `SAML2ByteAttributeTranscoder`, `SAML2DateTimeAttributeTranscoder`, `SAML2ScopedStringAttributeTranscoder`, `SAML2ScopedStringNameIDTranscoder`, `SAML2StringAttributeTranscoder`, `SAML2StringNameIDTranscoder`, `SAML2XMLObjectAttributeTranscoder`

@ThreadSafe public interface AttributeTranscoder<T> extends InitializableComponent
Transcoders are objects that support both attribute encoding and decoding for bidirectional translation between `IdPAttribute` format and technology-specific formats.

Implementations must take into account values of multiple types. An implementation encountering a value type it does not understand may either decide to ignore it or throw exceptions.

Transcoders implement a `Predicate` interface to determine their applicability to a request.

Transcoders MUST be thread-safe and stateless.

## Method Summary

Modifier and Type
Method
Description
`IdPAttribute`
`decode(ProfileRequestContext profileRequestContext, T input, TranscodingRule rule)`
Decode the supplied object into a protocol-neutral representation.
`T`
`encode(ProfileRequestContext profileRequestContext, IdPAttribute attribute, Class<? extends T> to, TranscodingRule rule)`
Encode the supplied attribute into a protocol specific representation.
`String`
`getEncodedName(TranscodingRule rule)`
Get the name of the encoded object that would be created by a given set of instructions.
`Class<T>`
`getEncodedType()`
Get the class representing the type of object supported by this transcoder.

### Methods inherited from interface net.shibboleth.shared.component.InitializableComponent

`initialize, isInitialized`

## Method Details

### getEncodedType

@Nonnull Class<T> getEncodedType()
Get the class representing the type of object supported by this transcoder.

Returns:
  object type supported

### getEncodedName

@Nullable @NotEmpty String getEncodedName(@Nonnull TranscodingRule rule)
Get the name of the encoded object that would be created by a given set of instructions.

Parameters:
  `rule` - properties governing the encoding process
Returns:
  a canonical name for objects produced by this transcoder for the given instructions

### encode

@Nullable T encode(@Nullable ProfileRequestContext profileRequestContext, @Nonnull IdPAttribute attribute, @Nonnull Class<? extends T> to, @Nonnull TranscodingRule rule) throws AttributeEncodingException
Encode the supplied attribute into a protocol specific representation.

Parameters:
  `profileRequestContext` - current profile request context
  `attribute` - the attribute to encode
  `to` - specific type of object to encode
  `rule` - properties governing the encoding process, principally the resulting object's naming
Returns:
  the Object the attribute was encoded into
Throws:
  `AttributeEncodingException` - if unable to successfully encode attribute

### decode

@Nullable IdPAttribute decode(@Nullable ProfileRequestContext profileRequestContext, @Nonnull T input, @Nonnull TranscodingRule rule) throws AttributeDecodingException
Decode the supplied object into a protocol-neutral representation.

Parameters:
  `profileRequestContext` - current profile request context
  `input` - the object to decode
  `rule` - properties governing the decoding process, principally the resulting attribute's naming
Returns:
  the attribute the object was decoded into
Throws:
  `AttributeDecodingException` - if unable to successfully decode object