|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.pfl.dynamic.codegen.impl.ClassInfoBase
org.glassfish.pfl.dynamic.codegen.impl.ClassGeneratorImpl
public final class ClassGeneratorImpl
Class used to generate a description of a class or interface. An interface is an abstract class, all of whose methods are abstract. Interfaces do not have a super class, an initializer, or constructors. Interfaces also do not have variables.
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.
| Method Summary | ||
|---|---|---|
void |
accept(Visitor visitor)
Accept the visitor and allow it to perform actions on this Node. |
|
FieldGenerator |
addField(int modifiers,
Type type,
String name)
|
|
List<Object> |
attributes()
Internal method for dynamic attribute support. |
|
Set<MethodInfo> |
constructorInfo()
|
|
List<MethodGenerator> |
constructors()
|
|
|
copy(Class<T> cls)
Make a deep copy of this node. |
|
|
copy(Node newParent,
Class<T> cls)
Copy setting a new parent in the result. |
|
List<FieldGenerator> |
fields()
|
|
Object |
get(int index)
Internal method for dynamic attribute support. |
|
|
getAncestor(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)
|
|
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,
Object obj)
Internal method for dynamic attribute support. |
|
MethodGenerator |
startConstructor(int modifiers,
List<Type> exceptions)
|
|
MethodGenerator |
startMethod(int modifiers,
Type rtype,
String name,
List<Type> exceptions)
|
|
| Methods inherited from class org.glassfish.pfl.dynamic.codegen.impl.ClassInfoBase |
|---|
addConstructorInfo, addFieldInfo, addMethodInfo, className, equals, fieldInfo, findConstructorInfo, findFieldInfo, findMethodInfo, hashCode, impls, initializeClass, initializeInterface, isInterface, isSubclass, methodInfoByName, modifiers, name, pkgName, superType, thisType, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface org.glassfish.pfl.dynamic.codegen.spi.ClassGenerator |
|---|
name |
| Methods inherited from interface org.glassfish.pfl.dynamic.codegen.spi.ClassInfo |
|---|
className, fieldInfo, findConstructorInfo, findFieldInfo, findMethodInfo, impls, isInterface, isSubclass, methodInfoByName, modifiers, pkgName, superType, thisType |
| Method Detail |
|---|
public Node parent()
Node
parent in interface Nodepublic int id()
Node
id in interface Nodepublic void parent(Node node)
Node
parent in interface Nodepublic <T extends Node> T getAncestor(Class<T> type)
Node
getAncestor in interface Nodepublic <T extends Node> T copy(Class<T> cls)
Node
copy in interface Node
public <T extends Node> T copy(Node newParent,
Class<T> cls)
Node
copy in interface Nodepublic Object get(int index)
AttributedObject
get in interface AttributedObject
public void set(int index,
Object obj)
AttributedObject
set in interface AttributedObjectpublic List<Object> attributes()
AttributedObject
attributes in interface AttributedObjectpublic BlockStatement initializer()
public List<FieldGenerator> fields()
public List<MethodGenerator> methods()
public List<MethodGenerator> constructors()
public Set<MethodInfo> constructorInfo()
constructorInfo in interface ClassInfoconstructorInfo in class ClassInfoBase
public MethodGenerator startMethod(int modifiers,
Type rtype,
String name,
List<Type> exceptions)
public MethodGenerator startConstructor(int modifiers,
List<Type> exceptions)
public void methodComplete(MethodGenerator mg)
public FieldGenerator addField(int modifiers,
Type type,
String name)
public void accept(Visitor visitor)
Node
accept in interface Node
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||