Package org.codehaus.groovy.ast
Class ConstructorNode
java.lang.Object
org.codehaus.groovy.ast.ASTNode
org.codehaus.groovy.ast.AnnotatedNode
org.codehaus.groovy.ast.MethodNode
org.codehaus.groovy.ast.ConstructorNode
- All Implemented Interfaces:
GroovydocHolder<AnnotatedNode>,NodeMetaDataHandler
Represents a constructor declaration
-
Field Summary
Fields inherited from interface groovy.lang.groovydoc.GroovydocHolder
DOC_COMMENT -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedLeaves the constructor unset so a subclass can fill the declaration in later.ConstructorNode(int modifiers, Parameter[] parameters, ClassNode[] exceptions, Statement code) Creates a constructor named <init> whose return type isvoid.ConstructorNode(int modifiers, Statement code) Creates a constructor with no parameters and no checked exceptions. -
Method Summary
Modifier and TypeMethodDescriptionbooleanReports whether the first statement is athis(...)orsuper(...)call.Methods inherited from class org.codehaus.groovy.ast.MethodNode
getCode, getExceptions, getFirstStatement, getGenericsTypes, getModifiers, getName, getParameters, getReturnType, getText, getTypeDescriptor, getTypeDescriptor, getVariableScope, hasAnnotationDefault, hasDefaultValue, isAbstract, isBridge, isConstructor, isDefault, isDynamicReturnType, isFinal, isPackageScope, isPrivate, isProtected, isPublic, isScriptBody, isStatic, isStaticConstructor, isSyntheticPublic, isVoidMethod, setAnnotationDefault, setCode, setGenericsTypes, setIsScriptBody, setModifiers, setParameters, setReturnType, setSyntheticPublic, setVariableScope, toStringMethods inherited from class org.codehaus.groovy.ast.AnnotatedNode
addAnnotation, addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, getGroovydoc, getInstance, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSyntheticMethods inherited from class org.codehaus.groovy.ast.ASTNode
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getMetaDataMap, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setMetaDataMap, setSourcePosition, visitMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.codehaus.groovy.ast.NodeMetaDataHandler
copyNodeMetaData, getNodeMetaData, getNodeMetaData, getNodeMetaData, newMetaDataMap, putNodeMetaData, removeNodeMetaData, setNodeMetaData
-
Constructor Details
-
ConstructorNode
protected ConstructorNode()Leaves the constructor unset so a subclass can fill the declaration in later. The name stays null and no exceptions are recorded. -
ConstructorNode
Creates a constructor with no parameters and no checked exceptions.- Parameters:
modifiers- JVM access flags for the constructorcode- constructor body
-
ConstructorNode
public ConstructorNode(int modifiers, Parameter[] parameters, ClassNode[] exceptions, Statement code) Creates a constructor named <init> whose return type isvoid.- Parameters:
modifiers- JVM access flags for the constructorparameters- constructor parametersexceptions- checked exceptions declared on the constructorcode- constructor body
-
-
Method Details
-
firstStatementIsSpecialConstructorCall
public boolean firstStatementIsSpecialConstructorCall()Reports whether the first statement is athis(...)orsuper(...)call.- Returns:
truewhen that statement is a special constructor call
-