public final class ClassGeneratorImpl extends ClassInfoBase implements ClassGenerator, Node
Note: the hashCode of a ClassGeneratorImpl changes whenever a method, constructor, or field is added, so do not put ClassGenerators into sets or maps unless they are fully populated.
| Modifier and Type | Method and Description |
|---|---|
void |
accept(Visitor visitor)
Accept the visitor and allow it to perform actions on this Node.
|
FieldGenerator |
addField(int modifiers,
Type type,
java.lang.String name) |
java.util.List<java.lang.Object> |
attributes()
Internal method for dynamic attribute support.
|
java.util.Set<MethodInfo> |
constructorInfo() |
java.util.List<MethodGenerator> |
constructors() |
<T extends Node> |
copy(java.lang.Class<T> cls)
Make a deep copy of this node.
|
<T extends Node> |
copy(Node newParent,
java.lang.Class<T> cls)
Copy setting a new parent in the result.
|
java.util.List<FieldGenerator> |
fields() |
java.lang.Object |
get(int index)
Internal method for dynamic attribute support.
|
<T extends Node> |
getAncestor(java.lang.Class<T> type)
Return the first ancestor of this node of the given type, if any.
|
int |
id()
Return the unique ID of this node.
|
BlockStatement |
initializer() |
void |
methodComplete(MethodGenerator mg) |
java.util.List<MethodGenerator> |
methods() |
Node |
parent()
Return the Node that contains (and created) this Node.
|
void |
parent(Node node)
Set the parent to a new value.
|
void |
set(int index,
java.lang.Object obj)
Internal method for dynamic attribute support.
|
MethodGenerator |
startConstructor(int modifiers,
java.util.List<Type> exceptions) |
MethodGenerator |
startMethod(int modifiers,
Type rtype,
java.lang.String name,
java.util.List<Type> exceptions) |
addConstructorInfo, addFieldInfo, addMethodInfo, className, equals, fieldInfo, findConstructorInfo, findFieldInfo, findMethodInfo, hashCode, impls, initializeClass, initializeInterface, isInterface, isSubclass, methodInfoByName, modifiers, name, pkgName, superType, thisType, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitnameclassName, fieldInfo, findConstructorInfo, findFieldInfo, findMethodInfo, impls, isInterface, isSubclass, methodInfoByName, modifiers, pkgName, superType, thisTypepublic Node parent()
Nodepublic int id()
Nodepublic void parent(Node node)
Nodepublic <T extends Node> T getAncestor(java.lang.Class<T> type)
NodegetAncestor in interface Nodepublic <T extends Node> T copy(java.lang.Class<T> cls)
Nodepublic <T extends Node> T copy(Node newParent, java.lang.Class<T> cls)
Nodepublic java.lang.Object get(int index)
AttributedObjectget in interface AttributedObjectpublic void set(int index,
java.lang.Object obj)
AttributedObjectset in interface AttributedObjectpublic java.util.List<java.lang.Object> attributes()
AttributedObjectattributes in interface AttributedObjectpublic BlockStatement initializer()
public java.util.List<FieldGenerator> fields()
public java.util.List<MethodGenerator> methods()
public java.util.List<MethodGenerator> constructors()
public java.util.Set<MethodInfo> constructorInfo()
constructorInfo in interface ClassInfoconstructorInfo in class ClassInfoBasepublic MethodGenerator startMethod(int modifiers, Type rtype, java.lang.String name, java.util.List<Type> exceptions)
public MethodGenerator startConstructor(int modifiers, java.util.List<Type> exceptions)
public void methodComplete(MethodGenerator mg)
public FieldGenerator addField(int modifiers, Type type, java.lang.String name)