Top Description Methods
org.jboss.marshalling

public Interface ClassResolver

Known Direct Implementers
org.jboss.marshalling.ModularClassResolver, org.jboss.marshalling.TransformingClassResolver, org.jboss.marshalling.AbstractClassResolver
Imports
java.io.IOException

A class annotator and resolver. Instances of this interface have the opportunity to append information (such as classloader information, or class bytes) to a written class descriptor. This information can then be used on unmarshalling to aid in the selection (or creation) of the proper Class based on the class descriptor and the annotation data.

Method Summary

Modifier and TypeMethod and Description
public void
annotateClass(Marshaller
the marshaller to write to
marshaller
,
Class<?>
the class that was written
clazz
)

Add optional information about a class to a stream.

public void
annotateProxyClass(Marshaller
the marshaller to write to
marshaller
,
Class<?>
the class that was written
proxyClass
)

Add optional information about a proxy class to a stream.

public String

Returns:

the class name
getClassName
(Class<?>
the class
clazz
)

Get the class name to write for a given class.

public String[]

Returns:

the proxy class interface names
getProxyInterfaces
(Class<?>
the proxy class
proxyClass
)

Get the interface names to write for a given proxy class.

public Class<?>

Returns:

the corresponding class
resolveClass
(Unmarshaller
the unmarshaller from which to read annotation data, if any
unmarshaller
,
String
the class name
name
,
long
the serial version UID
serialVersionUID
)

Load the local class for a class descriptor.

public Class<?>

Returns:

the proxy class
resolveProxyClass
(Unmarshaller
the unmarshaller from which to read annotation data, if any
unmarshaller
,
String[]
the class descriptor
interfaces
)

Load a proxy class that implements the given interfaces.

Method Detail

annotateClassback to summary
public void annotateClass(Marshaller marshaller, Class<?> clazz) throws IOException

Add optional information about a class to a stream. The class descriptor will already have been written.

Parameters
marshaller:Marshaller

the marshaller to write to

clazz:Class<?>

the class that was written

Exceptions
IOException:
if an error occurs
See Also
java.io.ObjectOutputStream#annotateClass(Class)
annotateProxyClassback to summary
public void annotateProxyClass(Marshaller marshaller, Class<?> proxyClass) throws IOException

Add optional information about a proxy class to a stream. The class descriptor will already have been written.

Parameters
marshaller:Marshaller

the marshaller to write to

proxyClass:Class<?>

the class that was written

Exceptions
IOException:
if an error occurs
See Also
java.io.ObjectOutputStream#annotateProxyClass(Class)
getClassNameback to summary
public String getClassName(Class<?> clazz) throws IOException

Get the class name to write for a given class. The class name will be written as part of the class descriptor.

Parameters
clazz:Class<?>

the class

Returns:String

the class name

Exceptions
IOException:
if an error occurs
getProxyInterfacesback to summary
public String[] getProxyInterfaces(Class<?> proxyClass) throws IOException

Get the interface names to write for a given proxy class. The interface names will be written as part of the class descriptor.

Parameters
proxyClass:Class<?>

the proxy class

Returns:String[]

the proxy class interface names

Exceptions
IOException:
if an error occurs
resolveClassback to summary
public Class<?> resolveClass(Unmarshaller unmarshaller, String name, long serialVersionUID) throws IOException, ClassNotFoundException

Load the local class for a class descriptor. The class descriptor has already been read, but any data written by annotateClass(Marshaller, Class) should be read by this method.

Parameters
unmarshaller:Unmarshaller

the unmarshaller from which to read annotation data, if any

name:String

the class name

serialVersionUID:long

the serial version UID

Returns:Class<?>

the corresponding class

Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if the class could not be loaded
See Also
java.io.ObjectInputStream#resolveClass(java.io.ObjectStreamClass)
resolveProxyClassback to summary
public Class<?> resolveProxyClass(Unmarshaller unmarshaller, String[] interfaces) throws IOException, ClassNotFoundException

Load a proxy class that implements the given interfaces.

Parameters
unmarshaller:Unmarshaller

the unmarshaller from which to read annotation data, if any

interfaces:String[]

the class descriptor

Returns:Class<?>

the proxy class

Exceptions
IOException:
if an I/O error occurs
ClassNotFoundException:
if the proxy class could not be loaded
See Also
java.io.ObjectInputStream#resolveProxyClass(String[])