public class InterfaceMaker extends AbstractClassGenerator
AbstractClassGenerator.ClassLoaderData, AbstractClassGenerator.Source
Modifier and Type | Field and Description |
---|---|
private java.util.Map |
signatures |
private static AbstractClassGenerator.Source |
SOURCE |
Constructor and Description |
---|
InterfaceMaker()
Create a new
InterfaceMaker . |
Modifier and Type | Method and Description |
---|---|
void |
add(java.lang.Class clazz)
Add all the public methods in the specified class.
|
void |
add(java.lang.reflect.Method method)
Add a method signature to the interface.
|
void |
add(Signature sig,
org.objectweb.asm.Type[] exceptions)
Add a method signature to the interface.
|
java.lang.Class |
create()
Create an interface using the current set of method signatures.
|
protected java.lang.Object |
firstInstance(java.lang.Class type) |
void |
generateClass(org.objectweb.asm.ClassVisitor v) |
protected java.lang.ClassLoader |
getDefaultClassLoader() |
protected java.lang.Object |
nextInstance(java.lang.Object instance) |
create, generate, getAttemptLoad, getClassLoader, getClassName, getCurrent, getNamingPolicy, getProtectionDomain, getStrategy, getUseCache, setAttemptLoad, setClassLoader, setNamePrefix, setNamingPolicy, setStrategy, setUseCache, unwrapCachedValue, wrapCachedClass
private static final AbstractClassGenerator.Source SOURCE
private java.util.Map signatures
public InterfaceMaker()
InterfaceMaker
. A new InterfaceMaker
object should be used for each generated interface, and should not
be shared across threads.public void add(Signature sig, org.objectweb.asm.Type[] exceptions)
sig
- the method signature to add to the interfaceexceptions
- an array of exception types to declare for the methodpublic void add(java.lang.reflect.Method method)
method
- the method to add to the interfacepublic void add(java.lang.Class clazz)
getClass
, equals
, hashCode
).class
- the class containing the methods to add to the interfacepublic java.lang.Class create()
protected java.lang.ClassLoader getDefaultClassLoader()
getDefaultClassLoader
in class AbstractClassGenerator
protected java.lang.Object firstInstance(java.lang.Class type)
firstInstance
in class AbstractClassGenerator
protected java.lang.Object nextInstance(java.lang.Object instance)
nextInstance
in class AbstractClassGenerator
public void generateClass(org.objectweb.asm.ClassVisitor v) throws java.lang.Exception
java.lang.Exception