Class MethodGenerator
java.lang.Object
org.glassfish.pfl.dynamic.codegen.impl.MemberInfoBase
org.glassfish.pfl.dynamic.codegen.impl.MethodInfoBase
org.glassfish.pfl.dynamic.codegen.impl.MethodGenerator
- All Implemented Interfaces:
AttributedObject, Node, MemberInfo, MethodInfo
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate booleanprivate BlockStatementprivate booleanprivate NodeFields inherited from class MethodInfoBase
arguments, exceptions, rtype -
Constructor Summary
ConstructorsConstructorDescriptionMethodGenerator(ClassGeneratorImpl parent, int modifiers, List<Type> exceptions) Construct a MethodGenerator that represents a constructor.MethodGenerator(ClassGeneratorImpl parent, int modifiers, Type rtype, String name, List<Type> exceptions) Construct a MethodGenerator that represents a method. -
Method Summary
Modifier and TypeMethodDescriptionvoidAccept the visitor and allow it to perform actions on this Node.addArgument(Type type, String ident) voidInternal method for dynamic attribute support.body()<T extends Node>
TMake a deep copy of this node.<T extends Node>
TCopy setting a new parent in the result.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.inthashCode()intid()Return the unique ID of this node.booleanReturns true if this is a constructor, false if method.parent()Return the Node that contains (and created) this Node.voidSet the parent to a new value.voidInternal method for dynamic attribute support.Methods inherited from class MethodInfoBase
arguments, clearHashCode, equals, exceptions, getConstructor, getMethod, returnType, signatureMethods inherited from class MemberInfoBase
isAccessibleInContext, modifiers, myClassInfo, name, toStringMethods inherited from interface MemberInfo
isAccessibleInContext, modifiers, myClassInfo, name
-
Field Details
-
nodeImpl
-
isConstructor
private boolean isConstructor -
argsComplete
private boolean argsComplete -
body
-
-
Constructor Details
-
MethodGenerator
MethodGenerator(ClassGeneratorImpl parent, int modifiers, List<Type> exceptions) Construct a MethodGenerator that represents a constructor. -
MethodGenerator
MethodGenerator(ClassGeneratorImpl parent, int modifiers, Type rtype, String name, List<Type> exceptions) Construct a MethodGenerator that represents a method.
-
-
Method Details
-
body
-
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
-
addArgument
-
isConstructor
public boolean isConstructor()Description copied from interface:MethodInfoReturns true if this is a constructor, false if method.- Specified by:
isConstructorin interfaceMethodInfo- Overrides:
isConstructorin classMethodInfoBase
-
argsComplete
public void argsComplete() -
hashCode
public int hashCode()- Overrides:
hashCodein classMethodInfoBase
-
accept
-