public interface MutableClassInfo extends ClassInfo
ABSTRACT, CONSTANT, FINAL, PACKAGE, PACKAGE_ABSTRACT, PACKAGE_CONSTANT, PACKAGE_STATIC, PRIVATE, PRIVATE_CONSTANT, PRIVATE_STATIC, PROTECTED, PROTECTED_ABSTRACT, PROTECTED_CONSTANT, PROTECTED_STATIC, PUBLIC, PUBLIC_ABSTRACT, PUBLIC_CONSTANT, PUBLIC_STATIC, STATIC
Modifier and Type | Method and Description |
---|---|
void |
addConstructor(MutableConstructorInfo mci)
Add a constructor
|
void |
addField(MutableFieldInfo mfi)
Add a field
|
void |
addMethod(MutableMethodInfo mmi)
Add a method
|
MutableConstructorInfo |
createMutableConstructor(Body body)
Compiles the code included in the Body parameter and returns a MutableConstructorInfo
representation of it.
|
MutableConstructorInfo |
createMutableConstructor(int modifiers,
Body body,
ClassInfo[] parameters,
ClassInfo[] exceptions)
Creates a constructor with the parameters given.
|
MutableConstructorInfo |
createMutableConstructor(int modifiers,
Body body,
String[] parameters,
String[] exceptions)
Creates a constructor with the parameters given.
|
MutableConstructorInfo |
createMutableConstructor(int modifiers,
ClassInfo[] parameters,
ClassInfo[] exceptions)
Creates an empty constructor with the parameters given.
|
MutableConstructorInfo |
createMutableConstructor(int modifiers,
String[] parameters,
String[] exceptions)
Creates an empty constructor with parameters given.
|
MutableFieldInfo |
createMutableField(int modifiers,
ClassInfo type,
String name)
Creates a field connected to this class with the parameters given.
|
MutableFieldInfo |
createMutableField(int modifiers,
String type,
String name)
Creates a field connected to this class with the parameters given.
|
MutableMethodInfo |
createMutableMethod(Body body)
Compiles the code included in Body and returns a MutableMethodInfo representation of it.
|
MutableMethodInfo |
createMutableMethod(int modifiers,
ClassInfo returnType,
String name,
Body body,
ClassInfo[] parameters,
ClassInfo[] exceptions)
Compiles a method with the signature and body given by the parameters.
|
MutableMethodInfo |
createMutableMethod(int modifiers,
ClassInfo returnType,
String name,
ClassInfo[] parameters,
ClassInfo[] exceptions)
Compiles an empty method with the signature given by the parameters.
|
MutableMethodInfo |
createMutableMethod(int modifiers,
String returnType,
String name,
Body body,
String[] parameters,
String[] exceptions)
Compiles a method with the signature and body given by the parameters.
|
MutableMethodInfo |
createMutableMethod(int modifiers,
String returnType,
String name,
String[] parameters,
String[] exceptions)
Compiles an empty method with the signature given by the parameters.
|
MutableConstructorInfo |
getDeclaredConstructor()
Gets the default constructor (parameterless)
|
MutableConstructorInfo |
getDeclaredConstructor(String... parameters)
Get a declared constructor
Note: the parameters will be loaded with the classloader defined in
TypeInfoFactory.
|
MutableConstructorInfo |
getDeclaredConstructor(TypeInfo... parameters)
Get a declared constructor
|
MutableConstructorInfo[] |
getDeclaredConstructors()
Get the declared constructors
|
MutableFieldInfo |
getDeclaredField(String name)
Get the declared field
|
MutableFieldInfo[] |
getDeclaredFields()
Get the declared fields
|
MutableMethodInfo |
getDeclaredMethod(String name)
Get the declared method without parameters.
|
MutableMethodInfo |
getDeclaredMethod(String name,
String... parameters)
Get the declared method
Note: the parameters will be loaded with the classloader defined in
TypeInfoFactory.
|
MutableMethodInfo |
getDeclaredMethod(String name,
TypeInfo... parameters)
Get the declared method
|
MutableMethodInfo[] |
getDeclaredMethods()
Get the declared methods
|
void |
removeConstructor(MutableConstructorInfo mci)
Remove the specified constructor from this class
|
void |
removeField(MutableFieldInfo mfi)
Remove a field
|
void |
removeMethod(MutableMethodInfo mmi)
Remove the specified method from this class
|
byte[] |
toByteCode()
Converts the class to a Class file.
|
getActualTypeArguments, getComponentType, getGenericInterfaces, getGenericSuperclass, getInterfaces, getKeyType, getName, getOwnerType, getPackage, getRawType, getSuperclass, getTypeVariable, getValueType, isInterface
getAnnotation, getAnnotations, getUnderlyingAnnotation, getUnderlyingAnnotations, isAnnotationPresent, isAnnotationPresent
getModifiers, isPublic, isStatic, isVolatile
convertValue, convertValue, convertValue, getArrayType, getAttachment, getAttachment, getClassLoader, getSimpleName, getType, getTypeInfoFactory, isAnnotation, isArray, isAssignableFrom, isCollection, isEnum, isInstance, isMap, isPrimitive, newArrayInstance, setAttachment
MutableMethodInfo getDeclaredMethod(String name)
name
- the method nameMutableMethodInfo getDeclaredMethod(String name, TypeInfo... parameters)
getDeclaredMethod
in interface ClassInfo
name
- the method nameparameters
- the parametersMutableMethodInfo getDeclaredMethod(String name, String... parameters) throws ClassNotFoundException
name
- the method nameparameters
- the parametersClassNotFoundException
MutableMethodInfo[] getDeclaredMethods()
getDeclaredMethods
in interface ClassInfo
MutableConstructorInfo[] getDeclaredConstructors()
getDeclaredConstructors
in interface ClassInfo
MutableConstructorInfo getDeclaredConstructor()
MutableConstructorInfo getDeclaredConstructor(TypeInfo... parameters)
getDeclaredConstructor
in interface ClassInfo
parameters
- the parametersMutableConstructorInfo getDeclaredConstructor(String... parameters) throws ClassNotFoundException
parameters
- the parametersClassNotFoundException
MutableFieldInfo getDeclaredField(String name)
getDeclaredField
in interface ClassInfo
name
- the field nameMutableFieldInfo[] getDeclaredFields()
getDeclaredFields
in interface ClassInfo
MutableMethodInfo createMutableMethod(Body body)
body
- contains the entire declaration of the method, including its signatureMutableMethodInfo createMutableMethod(int modifiers, String returnType, String name, String[] parameters, String[] exceptions)
modifiers
- the modifiers of the method to be createdreturnType
- the return type of the method to be createdname
- the name of the method to be createdparameters
- the parameters of the method to be createdexceptions
- the exceptions that the method to be created declares to throwMutableMethodInfo createMutableMethod(int modifiers, ClassInfo returnType, String name, ClassInfo[] parameters, ClassInfo[] exceptions)
modifiers
- the modifiers of the method to be createdreturnType
- the return type of the method to be createdname
- the name of the method to be createdparameters
- the parameters of the method to be createdexceptions
- the exceptions that the method to be created declares to throwMutableMethodInfo createMutableMethod(int modifiers, String returnType, String name, Body body, String[] parameters, String[] exceptions)
{}
.modifiers
- the modifiers of the method to be createdreturnType
- the return type of the method to be createdname
- the name of the method to be createdbody
- the body of the method to be createdparameters
- the parameters of the method to be createdexceptions
- the exceptions that the method to be created declares to throwMutableMethodInfo createMutableMethod(int modifiers, ClassInfo returnType, String name, Body body, ClassInfo[] parameters, ClassInfo[] exceptions)
{}
.modifiers
- the modifiers of the method to be createdreturnType
- the return type of the method to be createdname
- the name of the method to be createdbody
- the body of the method to be createdparameters
- the parameters of the method to be createdexceptions
- the exceptions that the method to be created declares to throwMutableConstructorInfo createMutableConstructor(Body body)
body
- contains the code of the constructor to be createdMutableConstructorInfo createMutableConstructor(int modifiers, String[] parameters, String[] exceptions)
modifiers
- the modifiers of the constructor to be createdparameters
- the parameters of the constructor to be createdexceptions
- the exceptions that the constructor to be created declares to throwMutableConstructorInfo createMutableConstructor(int modifiers, ClassInfo[] parameters, ClassInfo[] exceptions)
modifiers
- the modifiers of the constructor to be createdparameters
- the parameters of the constructor to be createdexceptions
- the exceptions that the constructor to be created declares to throwMutableConstructorInfo createMutableConstructor(int modifiers, Body body, String[] parameters, String[] exceptions)
{}
.modifiers
- the modifiers of the constructor to be createdbody
- the body of the constructor to be createdparameters
- the parameters of the constructor to be createdexceptions
- the exceptions that the constructor to be created declares to throwMutableConstructorInfo createMutableConstructor(int modifiers, Body body, ClassInfo[] parameters, ClassInfo[] exceptions)
{}
.modifiers
- the modifiers of the constructor to be createdbody
- the body of the constructor to be createdparameters
- the parameters of the constructor to be createdexceptions
- the exceptions that the constructor to be created declares to throwMutableFieldInfo createMutableField(int modifiers, String type, String name)
modifiers
- the modifiers of the field to be createdtype
- the type of the field to be createdname
- the name of the field to be createdMutableFieldInfo createMutableField(int modifiers, ClassInfo type, String name)
modifiers
- the modifiers of the field to be createdtype
- the type of the field to be createdname
- the name of the field to be createdvoid addMethod(MutableMethodInfo mmi)
mmi
- void removeMethod(MutableMethodInfo mmi)
mmi
- void addConstructor(MutableConstructorInfo mci)
mci
- void removeConstructor(MutableConstructorInfo mci)
mci
- void addField(MutableFieldInfo mfi)
mfi
- void removeField(MutableFieldInfo mfi)
mfi
- byte[] toByteCode()
Copyright © 2013 JBoss, a division of Red Hat, Inc.. All Rights Reserved.