@ThreadSafeAfterInit public class GenericPrincipalSerializer extends AbstractPrincipalSerializer<String>
| Modifier and Type | Field and Description |
|---|---|
private Set<Class<? extends Principal>> |
compatiblePrincipalTypes
A cache of Principal types that support string-based construction.
|
private static Pattern |
JSON_PATTERN
Pattern used to determine if input is supported.
|
private org.slf4j.Logger |
log
Class logger.
|
private static String |
PRINCIPAL_NAME_FIELD
Field name of principal name.
|
private static String |
PRINCIPAL_TYPE_FIELD
Field name of principal type.
|
private com.google.common.collect.BiMap<String,Integer> |
symbolics
Shrinkage of long constants into symbolic numbers.
|
| Constructor and Description |
|---|
GenericPrincipalSerializer()
Constructor.
|
| Modifier and Type | Method and Description |
|---|---|
Principal |
deserialize(String value) |
protected String |
desymbolize(javax.json.JsonValue field)
Map a field value to a string, either directly or via the symbolic map.
|
String |
serialize(Principal principal) |
void |
setSymbolics(Map<String,Integer> mappings)
Sets mappings of string constants to symbolic constants.
|
boolean |
supports(Principal principal) |
boolean |
supports(String value) |
getJsonGenerator, getJsonReaderdestroy, doDestroy, doInitialize, initialize, isDestroyed, isInitializedclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitinitialize, isInitialized@Nonnull @NotEmpty private static final String PRINCIPAL_TYPE_FIELD
@Nonnull @NotEmpty private static final String PRINCIPAL_NAME_FIELD
@Nonnull private static final Pattern JSON_PATTERN
@Nonnull private final org.slf4j.Logger log
@Nonnull @NonnullElements private com.google.common.collect.BiMap<String,Integer> symbolics
@Nonnull @NonnullElements private final Set<Class<? extends Principal>> compatiblePrincipalTypes
public void setSymbolics(@Nonnull@NonnullElements Map<String,Integer> mappings)
mappings - string to symbolic mappings@Nonnull @NotEmpty public String serialize(@Nonnull Principal principal) throws IOException
IOException@Nullable public Principal deserialize(@Nonnull@NotEmpty String value) throws IOException
IOExceptionCopyright © 1999–2018 Shibboleth Consortium. All rights reserved.