Top Description Constructors Methods
com.thoughtworks.xstream.converters.extended

public Class SubjectConverter

extends AbstractCollectionConverter
Class Inheritance
Imports
com.thoughtworks.xstream.converters.MarshallingContext, .UnmarshallingContext, com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter, com.thoughtworks.xstream.io.HierarchicalStreamReader, .HierarchicalStreamWriter, com.thoughtworks.xstream.mapper.Mapper, javax.security.auth.Subject, java.util.Collections, .HashSet, .Iterator, .Set

Converts a 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 com.thoughtworks.xstream.XStream.
Author
Jörg Schaible
Since
1.1.3

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public boolean
canConvert(Class<T>
the Class representing the object type to be converted
type
)

Implements abstract com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.canConvert.

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.
public void
marshal(Object
The object to be marshalled.
source
,
HierarchicalStreamWriter
A stream to write to.
writer
,
MarshallingContext
A context that allows nested objects to be processed by XStream.
context
)

Implements abstract com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.marshal.

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.
protected void
protected void
protected void
protected void
marshalReadOnly(boolean readOnly, HierarchicalStreamWriter writer)

protected Set<E>
public Object
unmarshal(HierarchicalStreamReader
The stream to read the text from.
reader
,
UnmarshallingContext context)

Implements abstract com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.unmarshal.

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.
protected Set<E>
protected Set<E>
protected Set<E>
protected boolean
Inherited from com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter:
createCollectionmapperreadBareItemreadCompleteItemreadItemwriteBareItemwriteCompleteItemwriteItemwriteNullItem

Constructor Detail

SubjectConverterback to summary
public SubjectConverter(Mapper mapper)

Method Detail

canConvertback to summary
public boolean canConvert(Class<T> type)

Implements abstract com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.canConvert.

Implements com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Doc from com.thoughtworks.xstream.converters.ConverterMatcher.canConvert.

Determines whether the converter can marshall a particular type.

Parameters
type:Class<T>

the Class representing the object type to be converted

marshalback to summary
public void marshal(Object source, HierarchicalStreamWriter writer, MarshallingContext context)

Implements abstract com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.marshal.

Implements com.thoughtworks.xstream.converters.Converter.marshal.

Doc from com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.

Parameters
source:Object

The object to be marshalled.

writer:HierarchicalStreamWriter

A stream to write to.

context:MarshallingContext

A context that allows nested objects to be processed by XStream.

marshalPrincipalsback to summary
protected void marshalPrincipals(Set<E> principals, HierarchicalStreamWriter writer, MarshallingContext context)
marshalPrivateCredentialsback to summary
protected void marshalPrivateCredentials(Set<E> privCredentials, HierarchicalStreamWriter writer, MarshallingContext context)
marshalPublicCredentialsback to summary
protected void marshalPublicCredentials(Set<E> pubCredentials, HierarchicalStreamWriter writer, MarshallingContext context)
marshalReadOnlyback to summary
protected void marshalReadOnly(boolean readOnly, HierarchicalStreamWriter writer)
populateSetback to summary
protected Set<E> populateSet(HierarchicalStreamReader reader, UnmarshallingContext context)
unmarshalback to summary
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)

Implements abstract com.thoughtworks.xstream.converters.collections.AbstractCollectionConverter.unmarshal.

Implements com.thoughtworks.xstream.converters.Converter.unmarshal.

Doc from com.thoughtworks.xstream.converters.Converter.unmarshal.

Convert textual data back into an object.

Parameters
reader:HierarchicalStreamReader

The stream to read the text from.

Returns:Object

The resulting object.

unmarshalPrincipalsback to summary
protected Set<E> unmarshalPrincipals(HierarchicalStreamReader reader, UnmarshallingContext context)
unmarshalPrivateCredentialsback to summary
protected Set<E> unmarshalPrivateCredentials(HierarchicalStreamReader reader, UnmarshallingContext context)
unmarshalPublicCredentialsback to summary
protected Set<E> unmarshalPublicCredentials(HierarchicalStreamReader reader, UnmarshallingContext context)
unmarshalReadOnlyback to summary
protected boolean unmarshalReadOnly(HierarchicalStreamReader reader)