public class MethodNode extends AnnotatedNode
Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Modifiers | Name | Description |
---|---|---|
static String |
SCRIPT_BODY_METHOD_KEY |
Type | Name and description |
---|---|
Statement |
getCode() |
ClassNode[] |
getExceptions() |
Statement |
getFirstStatement() |
GenericsType[] |
getGenericsTypes() |
int |
getModifiers() |
String |
getName() |
Parameter[] |
getParameters() |
ClassNode |
getReturnType() |
String |
getText() Provides a nicely formatted string of the method definition. |
String |
getTypeDescriptor() The type descriptor for a method node is a string containing the name of the method, its return type, and its parameter types in a canonical form. |
VariableScope |
getVariableScope() |
boolean |
hasAnnotationDefault() |
boolean |
hasDefaultValue() |
boolean |
isAbstract() |
boolean |
isDynamicReturnType() |
boolean |
isFinal() |
boolean |
isPrivate() |
boolean |
isProtected() |
boolean |
isPublic() |
boolean |
isScriptBody() @return true if this method is the run method from a script |
boolean |
isStatic() |
boolean |
isStaticConstructor() |
boolean |
isSyntheticPublic() Indicates that this method has been "promoted" to public by Groovy when in fact there was no public modifier explicitly in the source code. |
boolean |
isVoidMethod() |
void |
setAnnotationDefault(boolean b) |
void |
setCode(Statement code) |
void |
setGenericsTypes(GenericsType[] genericsTypes) |
void |
setIsScriptBody() Set the metadata flag for this method to indicate that it is a script body implementation. |
void |
setModifiers(int modifiers) |
void |
setParameters(Parameter[] parameters) |
void |
setReturnType(ClassNode returnType) |
void |
setSyntheticPublic(boolean syntheticPublic) |
void |
setVariableScope(VariableScope variableScope) |
String |
toString() |
Methods inherited from class | Name |
---|---|
class AnnotatedNode |
addAnnotation, addAnnotations, getAnnotations, getAnnotations, getDeclaringClass, hasNoRealSourcePosition, isSynthetic, setDeclaringClass, setHasNoRealSourcePosition, setSynthetic |
class ASTNode |
copyNodeMetaData, getColumnNumber, getLastColumnNumber, getLastLineNumber, getLineNumber, getNodeMetaData, getNodeMetaData, getText, putNodeMetaData, removeNodeMetaData, setColumnNumber, setLastColumnNumber, setLastLineNumber, setLineNumber, setNodeMetaData, setSourcePosition, visit |
class Object |
wait, wait, wait, equals, toString, hashCode, getClass, notify, notifyAll |
Provides a nicely formatted string of the method definition. For simplicity, generic types on some of the elements are not displayed.
The type descriptor for a method node is a string containing the name of the method, its return type, and its parameter types in a canonical form. For simplicity, I'm using the format of a Java declaration without parameter names.
Indicates that this method has been "promoted" to public by Groovy when in fact there was no public modifier explicitly in the source code. I.e. it remembers that it has applied Groovy's "public methods by default" rule. This property is typically only of interest to AST transform writers.
Set the metadata flag for this method to indicate that it is a script body implementation.
Copyright © 2003-2015 The Apache Software Foundation. All rights reserved.