|
Marshalling API version 1.0.0.GA | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.marshalling.AbstractClassResolver
public abstract class AbstractClassResolver
A base implementation of ClassResolver
which simply resolves the class
against a classloader which is specified by the subclass implementation.
Constructor Summary | |
---|---|
protected |
AbstractClassResolver()
Construct a new instance. |
Method Summary | |
---|---|
void |
annotateClass(Marshaller marshaller,
Class<?> clazz)
Add optional information about a class to a stream. |
void |
annotateProxyClass(Marshaller marshaller,
Class<?> proxyClass)
Add optional information about a proxy class to a stream. |
protected abstract ClassLoader |
getClassLoader()
Get the classloader to use to resolve classes for this resolver. |
Class<?> |
resolveClass(Unmarshaller unmarshaller,
String name,
long serialVersionUID)
Load the local class for a class descriptor. |
Class<?> |
resolveProxyClass(Unmarshaller unmarshaller,
String[] interfaces)
Load a proxy class that implements the given interfaces. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected AbstractClassResolver()
Method Detail |
---|
protected abstract ClassLoader getClassLoader()
public void annotateClass(Marshaller marshaller, Class<?> clazz) throws IOException
annotateClass
in interface ClassResolver
marshaller
- the marshaller to write toclazz
- the class that was written
IOException
- if an error occursObjectOutputStream.annotateClass(Class)
public void annotateProxyClass(Marshaller marshaller, Class<?> proxyClass) throws IOException
annotateProxyClass
in interface ClassResolver
marshaller
- the marshaller to write toproxyClass
- the chass that was written
IOException
- if an error occursObjectOutputStream.annotateProxyClass(Class)
public Class<?> resolveClass(Unmarshaller unmarshaller, String name, long serialVersionUID) throws IOException, ClassNotFoundException
ClassResolver.annotateClass(Marshaller, Class)
should be read by this method. The base implementation uses the class loader returned from getClassLoader()
and
loads the class by name.
resolveClass
in interface ClassResolver
unmarshaller
- the unmarshaller from which to read annotation data, if anyname
- the class nameserialVersionUID
- the serial version UID
IOException
- if an I/O error occurs
ClassNotFoundException
- if the class could not be loadedObjectInputStream.resolveClass(java.io.ObjectStreamClass)
public Class<?> resolveProxyClass(Unmarshaller unmarshaller, String[] interfaces) throws IOException, ClassNotFoundException
getClassLoader()
and loads
each interface by name, returning a proxy class from that class loader.
resolveProxyClass
in interface ClassResolver
unmarshaller
- the unmarshaller from which to read annotation data, if anyinterfaces
- the class descriptor
IOException
- if an I/O error occurs
ClassNotFoundException
- if the proxy class could not be loadedObjectInputStream.resolveProxyClass(String[])
|
Marshalling API version 1.0.0.GA | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |