Package org.codehaus.janino
Class Java.FunctionDeclarator
- java.lang.Object
-
- org.codehaus.janino.Java.Located
-
- org.codehaus.janino.Java.AbstractTypeBodyDeclaration
-
- org.codehaus.janino.Java.FunctionDeclarator
-
- All Implemented Interfaces:
Java.DocCommentable
,Java.Locatable
,Java.Scope
,Java.TypeBodyDeclaration
- Direct Known Subclasses:
Java.ConstructorDeclarator
,Java.MethodDeclarator
- Enclosing class:
- Java
public abstract static class Java.FunctionDeclarator extends Java.AbstractTypeBodyDeclaration implements Java.DocCommentable
Abstract base class forJava.ConstructorDeclarator
andJava.MethodDeclarator
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Java.FunctionDeclarator.FormalParameter
Representation of a (formal) function parameter.static class
Java.FunctionDeclarator.FormalParameters
Representation of the (formal) function parameters.
-
Field Summary
Fields Modifier and Type Field Description Java.FunctionDeclarator.FormalParameters
formalParameters
The parameters of the function.Map<String,Java.LocalVariable>
localVariables
Mapping of variable names toJava.LocalVariable
s.Java.Modifiers
modifiers
TheJava.Modifiers
of this declarator.String
name
The name of the function ("" for constructors. List<? extends Java.BlockStatement>
optionalStatements
The statements that comprise the function;null
for abstract method declarations.Java.Type[]
thrownExceptions
The types of the declared exceptions.Java.Type
type
The return type of the function (VOID for constructors).-
Fields inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
statiC
-
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
-
-
Constructor Summary
Constructors Constructor Description FunctionDeclarator(Location location, String optionalDocComment, Java.Modifiers modifiers, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters parameters, Java.Type[] thrownExceptions, List<? extends Java.BlockStatement> optionalStatements)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
accept(Visitor.FunctionDeclaratorVisitor visitor)
Invokes the 'visit...()
' method ofVisitor.FunctionDeclaratorVisitor
for the concreteJava.FunctionDeclarator
type.Java.Annotation[]
getAnnotations()
String
getDocComment()
Java.Scope
getEnclosingScope()
boolean
hasDeprecatedDocTag()
Returnstrue
if the object has a doc comment and the@deprecated
tag appears in the doc comment.void
setDeclaringType(Java.TypeDeclaration declaringType)
Sets the type declaration that this declaration belongs to.-
Methods inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
getDeclaringType, isStatic, setEnclosingScope
-
Methods inherited from class org.codehaus.janino.Java.Located
getLocation, throwCompileException
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
-
Methods inherited from interface org.codehaus.janino.Java.TypeBodyDeclaration
accept
-
-
-
-
Field Detail
-
modifiers
public final Java.Modifiers modifiers
TheJava.Modifiers
of this declarator.
-
type
public final Java.Type type
The return type of the function (VOID for constructors).
-
name
public final String name
The name of the function ("" for constructors.
-
formalParameters
public final Java.FunctionDeclarator.FormalParameters formalParameters
The parameters of the function.
-
thrownExceptions
public final Java.Type[] thrownExceptions
The types of the declared exceptions.
-
optionalStatements
public final List<? extends Java.BlockStatement> optionalStatements
The statements that comprise the function;null
for abstract method declarations.
-
localVariables
public Map<String,Java.LocalVariable> localVariables
Mapping of variable names toJava.LocalVariable
s.
-
-
Constructor Detail
-
FunctionDeclarator
public FunctionDeclarator(Location location, String optionalDocComment, Java.Modifiers modifiers, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters parameters, Java.Type[] thrownExceptions, List<? extends Java.BlockStatement> optionalStatements)
-
-
Method Detail
-
getAnnotations
public Java.Annotation[] getAnnotations()
- Returns:
- The annotations of this function
-
accept
public abstract void accept(Visitor.FunctionDeclaratorVisitor visitor)
Invokes the 'visit...()
' method ofVisitor.FunctionDeclaratorVisitor
for the concreteJava.FunctionDeclarator
type.
-
setDeclaringType
public void setDeclaringType(Java.TypeDeclaration declaringType)
Description copied from interface:Java.TypeBodyDeclaration
Sets the type declaration that this declaration belongs to.- Specified by:
setDeclaringType
in interfaceJava.TypeBodyDeclaration
- Overrides:
setDeclaringType
in classJava.AbstractTypeBodyDeclaration
-
getEnclosingScope
public Java.Scope getEnclosingScope()
- Specified by:
getEnclosingScope
in interfaceJava.Scope
- Overrides:
getEnclosingScope
in classJava.AbstractTypeBodyDeclaration
- Returns:
- The scope that encloses this scope, or
null
-
getDocComment
public String getDocComment()
- Specified by:
getDocComment
in interfaceJava.DocCommentable
- Returns:
- The doc comment of the object or
null
-
hasDeprecatedDocTag
public boolean hasDeprecatedDocTag()
Description copied from interface:Java.DocCommentable
Returnstrue
if the object has a doc comment and the@deprecated
tag appears in the doc comment.- Specified by:
hasDeprecatedDocTag
in interfaceJava.DocCommentable
-
-