Class ClassGeneratorImpl
java.lang.Object
org.glassfish.pfl.dynamic.codegen.impl.ClassInfoBase
org.glassfish.pfl.dynamic.codegen.impl.ClassGeneratorImpl
- All Implemented Interfaces:
AttributedObject, Node, ClassGenerator, ClassInfo
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.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate List<MethodGenerator> private List<FieldGenerator> private BlockStatementprivate List<MethodGenerator> private Node -
Constructor Summary
ConstructorsConstructorDescriptionClassGeneratorImpl(int modifiers, String name, List<Type> impls) Construct a ClassGeneratorImpl representing an interface.ClassGeneratorImpl(int modifiers, String name, Type superType, List<Type> impls) Construct a ClassGeneratorImpl representing a class. -
Method Summary
Modifier and TypeMethodDescriptionvoidAccept the visitor and allow it to perform actions on this Node.Internal method for dynamic attribute support.<T extends Node>
TMake a deep copy of this node.<T extends Node>
TCopy setting a new parent in the result.fields()get(int index) Internal method for dynamic attribute support.<T extends Node>
TgetAncestor(Class<T> type) Return the first ancestor of this node of the given type, if any.intid()Return the unique ID of this node.voidmethods()parent()Return the Node that contains (and created) this Node.voidSet the parent to a new value.voidInternal method for dynamic attribute support.startConstructor(int modifiers, List<Type> exceptions) startMethod(int modifiers, Type rtype, String name, List<Type> exceptions) Methods inherited from class ClassInfoBase
addConstructorInfo, addFieldInfo, addMethodInfo, className, equals, fieldInfo, findConstructorInfo, findFieldInfo, findMethodInfo, hashCode, impls, initializeClass, initializeInterface, isInterface, isSubclass, methodInfoByName, modifiers, name, pkgName, superType, thisType, toStringMethods inherited from interface ClassGenerator
nameMethods inherited from interface ClassInfo
className, fieldInfo, findConstructorInfo, findFieldInfo, findMethodInfo, impls, isInterface, isSubclass, methodInfoByName, modifiers, pkgName, superType, thisType
-
Field Details
-
nodeImpl
-
initializer
-
methods
-
constructors
-
fields
-
-
Constructor Details
-
ClassGeneratorImpl
-
ClassGeneratorImpl
-
-
Method Details
-
parent
-
id
-
parent
-
getAncestor
Description copied from interface:NodeReturn the first ancestor of this node of the given type, if any. Throws IllegalArgumentException if not found.- Specified by:
getAncestorin interfaceNode
-
copy
-
copy
-
get
Description copied from interface:AttributedObjectInternal method for dynamic attribute support. Return the value of the attribute at index. If the attribute at index is not set, set it to the default value and return the default.- Specified by:
getin interfaceAttributedObject
-
set
Description copied from interface:AttributedObjectInternal method for dynamic attribute support. Set the attribute at index to obj.- Specified by:
setin interfaceAttributedObject
-
attributes
Description copied from interface:AttributedObjectInternal method for dynamic attribute support. Return all attributes for this node (may be null).- Specified by:
attributesin interfaceAttributedObject
-
initializer
-
fields
-
methods
-
constructors
-
constructorInfo
- Specified by:
constructorInfoin interfaceClassInfo- Overrides:
constructorInfoin classClassInfoBase
-
startMethod
-
startConstructor
-
methodComplete
-
addField
-
accept
-