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

public Class JavaMethodConverter

extends Object
implements Converter
Class Inheritance
All Implemented Interfaces
com.thoughtworks.xstream.converters.Converter, com.thoughtworks.xstream.converters.ConverterMatcher
Imports
com.thoughtworks.xstream.converters.ConversionException, .Converter, .MarshallingContext, .SingleValueConverter, .UnmarshallingContext, com.thoughtworks.xstream.core.ClassLoaderReference, com.thoughtworks.xstream.io.HierarchicalStreamReader, .HierarchicalStreamWriter, java.lang.reflect.Constructor, .Method, java.util.ArrayList, .List

Converts a java.lang.reflect.Method to XML.
Authors
Aslak Hellesøy, Jörg Schaible

Field Summary

Modifier and TypeField and Description
private final SingleValueConverter

Constructor Summary

AccessConstructor and Description
public
JavaMethodConverter(ClassLoaderReference
the reference to the ClassLoader of the XStream instance
classLoaderReference
)

Construct a JavaMethodConverter.

public
protected
JavaMethodConverter(SingleValueConverter
the converter to use
javaClassConverter
)

Construct a JavaMethodConverter.

Method Summary

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

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 com.thoughtworks.xstream.converters.Converter.marshal.

Convert an object to textual data.
private void
marshalMethod(HierarchicalStreamWriter writer, String declaringClassName, String methodName, Class<T>[] parameterTypes)

public Object
unmarshal(HierarchicalStreamReader
The stream to read the text from.
reader
,
UnmarshallingContext context)

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

Convert textual data back into an object.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

javaClassConverterback to summary
private final SingleValueConverter javaClassConverter

Constructor Detail

JavaMethodConverterback to summary
public JavaMethodConverter(ClassLoaderReference classLoaderReference)

Construct a JavaMethodConverter.

Parameters
classLoaderReference:ClassLoaderReference

the reference to the ClassLoader of the XStream instance

Since
1.4.5
JavaMethodConverterback to summary
public JavaMethodConverter(ClassLoader classLoader)

Deprecated

As of 1.4.5 use JavaMethodConverter(ClassLoaderReference)

JavaMethodConverterback to summary
protected JavaMethodConverter(SingleValueConverter javaClassConverter)

Construct a JavaMethodConverter.

Parameters
javaClassConverter:SingleValueConverter

the converter to use

Since
1.4.5

Method Detail

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

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 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.

marshalMethodback to summary
private void marshalMethod(HierarchicalStreamWriter writer, String declaringClassName, String methodName, Class<T>[] parameterTypes)
unmarshalback to summary
public Object unmarshal(HierarchicalStreamReader reader, UnmarshallingContext context)

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.