Package net.shibboleth.idp.authn.principal

# Class AbstractPrincipalSerializer<Type>

java.lang.Object
net.shibboleth.shared.component.AbstractInitializableComponent
net.shibboleth.idp.authn.principal.AbstractPrincipalSerializer<Type>

Type Parameters:
  `Type` - generic type of serialization

All Implemented Interfaces:
  `PrincipalSerializer<Type>`, `Component`, `DestructableComponent`, `InitializableComponent`

Direct Known Subclasses:
  `AuthenticationResultPrincipalSerializer`, `GenericPrincipalSerializer`, `IdPAttributePrincipalSerializer`, `LDAPPrincipalSerializer`, `NameIDPrincipalSerializer`, `ProxyAuthenticationPrincipalSerializer`, `SimplePrincipalSerializer`, `X500PrincipalSerializer`

@ThreadSafe public abstract class AbstractPrincipalSerializer<Type> extends AbstractInitializableComponent implements PrincipalSerializer<Type>
Base class for `PrincipalSerializer` implementations.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final JsonGeneratorFactory`
`generatorFactory`
JSON generator factory.
`private final JsonReaderFactory`
`readerFactory`
JSON reader factory.

## Constructor Summary

Constructors
Constructor
Description
`AbstractPrincipalSerializer()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`protected JsonGenerator`
`getJsonGenerator(Writer writer)`
Get a `JsonGenerator`, synchronized for thread-safety.
`protected JsonReader`
`getJsonReader(Reader reader)`
Get a `JsonReader`, synchronized for thread-safety.

### Methods inherited from class net.shibboleth.shared.component.AbstractInitializableComponent

`checkComponentActive, checkSetterPreconditions, destroy, doDestroy, doInitialize, ifDestroyedThrowDestroyedComponentException, ifInitializedThrowUnmodifiabledComponentException, ifNotInitializedThrowUninitializedComponentException, initialize, isDestroyed, isInitialized`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

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

`initialize, isInitialized`

### Methods inherited from interface net.shibboleth.idp.authn.principal.PrincipalSerializer

`deserialize, serialize, supports, supports`

## Field Details

### generatorFactory

@Nonnull private final JsonGeneratorFactory generatorFactory
JSON generator factory.

### readerFactory

@Nonnull private final JsonReaderFactory readerFactory
JSON reader factory.

## Constructor Details

### AbstractPrincipalSerializer

public AbstractPrincipalSerializer()
Constructor.

## Method Details

### getJsonGenerator

@Nonnull protected JsonGenerator getJsonGenerator(@Nonnull Writer writer)
Get a `JsonGenerator`, synchronized for thread-safety.

Parameters:
  `writer` - destination for output
Returns:
  a generator

### getJsonReader

@Nonnull protected JsonReader getJsonReader(@Nonnull Reader reader)
Get a `JsonReader`, synchronized for thread-safety.

Parameters:
  `reader` - source of input
Returns:
  a reader