public class SubjectConverter extends AbstractCollectionConverter
Subject
instance. Note, that this Converter does only convert the contained Principals as
it is done by JDK serialization, but not any credentials. For other behaviour you can derive your own converter,
overload the appropriate methods and register it in the XStream
.Constructor and Description |
---|
SubjectConverter(Mapper mapper) |
Modifier and Type | Method and Description |
---|---|
boolean |
canConvert(java.lang.Class type)
Determines whether the converter can marshall a particular type.
|
void |
marshal(java.lang.Object source,
HierarchicalStreamWriter writer,
MarshallingContext context)
Convert an object to textual data.
|
protected void |
marshalPrincipals(java.util.Set principals,
HierarchicalStreamWriter writer,
MarshallingContext context) |
protected void |
marshalPrivateCredentials(java.util.Set privCredentials,
HierarchicalStreamWriter writer,
MarshallingContext context) |
protected void |
marshalPublicCredentials(java.util.Set pubCredentials,
HierarchicalStreamWriter writer,
MarshallingContext context) |
protected void |
marshalReadOnly(boolean readOnly,
HierarchicalStreamWriter writer) |
protected java.util.Set |
populateSet(HierarchicalStreamReader reader,
UnmarshallingContext context) |
java.lang.Object |
unmarshal(HierarchicalStreamReader reader,
UnmarshallingContext context)
Convert textual data back into an object.
|
protected java.util.Set |
unmarshalPrincipals(HierarchicalStreamReader reader,
UnmarshallingContext context) |
protected java.util.Set |
unmarshalPrivateCredentials(HierarchicalStreamReader reader,
UnmarshallingContext context) |
protected java.util.Set |
unmarshalPublicCredentials(HierarchicalStreamReader reader,
UnmarshallingContext context) |
protected boolean |
unmarshalReadOnly(HierarchicalStreamReader reader) |
createCollection, mapper, readBareItem, readCompleteItem, readItem, writeBareItem, writeCompleteItem, writeItem, writeNullItem
public SubjectConverter(Mapper mapper)
public boolean canConvert(java.lang.Class type)
ConverterMatcher
canConvert
in interface ConverterMatcher
canConvert
in class AbstractCollectionConverter
type
- the Class representing the object type to be convertedpublic void marshal(java.lang.Object source, HierarchicalStreamWriter writer, MarshallingContext context)
Converter
marshal
in interface Converter
marshal
in class AbstractCollectionConverter
source
- The object to be marshalled.writer
- A stream to write to.context
- A context that allows nested objects to be processed by XStream.protected void marshalPrincipals(java.util.Set principals, HierarchicalStreamWriter writer, MarshallingContext context)
protected void marshalPublicCredentials(java.util.Set pubCredentials, HierarchicalStreamWriter writer, MarshallingContext context)
protected void marshalPrivateCredentials(java.util.Set privCredentials, HierarchicalStreamWriter writer, MarshallingContext context)
protected void marshalReadOnly(boolean readOnly, HierarchicalStreamWriter writer)
public java.lang.Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)
Converter
unmarshal
in interface Converter
unmarshal
in class AbstractCollectionConverter
reader
- The stream to read the text from.protected java.util.Set unmarshalPrincipals(HierarchicalStreamReader reader, UnmarshallingContext context)
protected java.util.Set unmarshalPublicCredentials(HierarchicalStreamReader reader, UnmarshallingContext context)
protected java.util.Set unmarshalPrivateCredentials(HierarchicalStreamReader reader, UnmarshallingContext context)
protected boolean unmarshalReadOnly(HierarchicalStreamReader reader)
protected java.util.Set populateSet(HierarchicalStreamReader reader, UnmarshallingContext context)
Copyright © 2004–2024 XStream. All rights reserved.