Package org.jboss.marshalling.cloner
Interface ClassCloner
-
- All Known Implementing Classes:
ClassLoaderClassCloner
public interface ClassCloner
A cloner for class types. Used (for example) to load an equivalent class from an alternate classloader.
-
-
Field Summary
Fields Modifier and Type Field Description static ClassCloner
IDENTITY
A class cloner which just returns the class it is given.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Class<?>
clone(Class<?> original)
Clone the given class.Class<?>
cloneProxy(Class<?> proxyClass)
Clone the given reflection proxy class.
-
-
-
Field Detail
-
IDENTITY
static final ClassCloner IDENTITY
A class cloner which just returns the class it is given. This cloner can be used in cases where an object must be deep-cloned within the same class loader.
-
-
Method Detail
-
clone
Class<?> clone(Class<?> original) throws IOException, ClassNotFoundException
Clone the given class.- Parameters:
original
- the class to clone- Returns:
- the cloned class
- Throws:
IOException
- if cloning fails due to a serialization problemClassNotFoundException
- if cloning fails due to an unavailable class
-
cloneProxy
Class<?> cloneProxy(Class<?> proxyClass) throws IOException, ClassNotFoundException
Clone the given reflection proxy class.- Parameters:
proxyClass
- the proxy class to clone- Returns:
- the cloned proxy class
- Throws:
IOException
- if cloning fails due to a serialization problemClassNotFoundException
- if cloning fails due to an unavailable class
-
-