|
JBoss Marshalling 1.2.1.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.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.
| Field Summary | |
|---|---|
protected boolean |
enforceSerialVersionUid
Specifies whether an exception should be thrown on an incorrect serialVersionUID. |
| Constructor Summary | |
|---|---|
protected |
AbstractClassResolver()
Construct a new instance. |
protected |
AbstractClassResolver(boolean enforceSerialVersionUid)
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. |
String |
getClassName(Class<?> clazz)
Get the class name to write for a given class. |
String[] |
getProxyInterfaces(Class<?> proxyClass)
Get the interface names to write for a given proxy class. |
protected Class<?> |
loadClass(String name)
Load a class with the given name. |
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 |
| Field Detail |
|---|
protected final boolean enforceSerialVersionUid
| Constructor Detail |
|---|
protected AbstractClassResolver()
protected AbstractClassResolver(boolean enforceSerialVersionUid)
enforceSerialVersionUid - true if an exception should be thrown on an incorrect serialVersionUID| Method Detail |
|---|
protected abstract ClassLoader getClassLoader()
public void annotateClass(Marshaller marshaller,
Class<?> clazz)
throws IOException
annotateClass in interface ClassResolvermarshaller - 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 ClassResolvermarshaller - the marshaller to write toproxyClass - the chass that was written
IOException - if an error occursObjectOutputStream.annotateProxyClass(Class)
public String getClassName(Class<?> clazz)
throws IOException
getClassName in interface ClassResolverclazz - the class
IOException - if an error occurs
public String[] getProxyInterfaces(Class<?> proxyClass)
throws IOException
getClassName() implemented by the given class.
getProxyInterfaces in interface ClassResolverproxyClass - the proxy class
IOException - if an error occurs
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 ClassResolverunmarshaller - 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)
protected Class<?> loadClass(String name)
throws ClassNotFoundException
getClassLoader().
name - the name of the class
ClassNotFoundException - if the class is not found, or if there is no classloader
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 ClassResolverunmarshaller - 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[])
|
JBoss Marshalling 1.2.1.GA | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||