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.Annotatable
,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.Annotatable, 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.java.util.Map<java.lang.String,Java.LocalVariable>
localVariables
Mapping of variable names toJava.LocalVariable
s.java.lang.String
name
The name of the function ("<init>"
for constructors).java.util.List<? extends Java.BlockStatement>
statements
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
modifiers
-
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
-
-
Constructor Summary
Constructors Constructor Description FunctionDeclarator(Location location, java.lang.String docComment, Java.Modifier[] modifiers, Java.Type type, java.lang.String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, java.util.List<? extends Java.BlockStatement> statements)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract <R,EX extends java.lang.Throwable>
Raccept(Visitor.FunctionDeclaratorVisitor<R,EX> visitor)
Invokes the "visit...()
" method ofVisitor.FunctionDeclaratorVisitor
for the concreteJava.FunctionDeclarator
type.<R,EX extends java.lang.Throwable>
Raccept(Visitor.TypeBodyDeclarationVisitor<R,EX> visitor)
Invokes the "visit...()
" method ofVisitor.TypeBodyDeclarationVisitor
for the concreteJava.TypeBodyDeclaration
type.Access
getAccess()
Java.Annotation[]
getAnnotations()
java.lang.String
getDocComment()
Java.Scope
getEnclosingScope()
boolean
hasDeprecatedDocTag()
Returnstrue
if the object has a doc comment and the@deprecated
tag appears in the doc comment.boolean
isStrictfp()
void
setDeclaringType(Java.TypeDeclaration declaringType)
Sets the type declaration that this declaration belongs to.void
setEnclosingScope(Java.Scope enclosingScope)
Forward-implementsJava.BlockStatement.setEnclosingScope(Java.Scope)
.-
Methods inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
getDeclaringType, getModifiers
-
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
-
-
-
-
Field Detail
-
type
public final Java.Type type
The return type of the function (VOID for constructors).
-
name
public final java.lang.String name
The name of the function ("<init>"
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.
-
statements
@Nullable public final java.util.List<? extends Java.BlockStatement> statements
The statements that comprise the function;null
for abstract method declarations.
-
localVariables
@Nullable public java.util.Map<java.lang.String,Java.LocalVariable> localVariables
Mapping of variable names toJava.LocalVariable
s.
-
-
Constructor Detail
-
FunctionDeclarator
public FunctionDeclarator(Location location, @Nullable java.lang.String docComment, Java.Modifier[] modifiers, Java.Type type, java.lang.String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, @Nullable java.util.List<? extends Java.BlockStatement> statements)
-
-
Method Detail
-
getAccess
public Access getAccess()
-
getAnnotations
public Java.Annotation[] getAnnotations()
- Specified by:
getAnnotations
in interfaceJava.Annotatable
- Overrides:
getAnnotations
in classJava.AbstractTypeBodyDeclaration
- Returns:
- The annotations of this function
-
accept
@Nullable public final <R,EX extends java.lang.Throwable> R accept(Visitor.TypeBodyDeclarationVisitor<R,EX> visitor) throws EX extends java.lang.Throwable
Description copied from interface:Java.TypeBodyDeclaration
Invokes the "visit...()
" method ofVisitor.TypeBodyDeclarationVisitor
for the concreteJava.TypeBodyDeclaration
type.- Specified by:
accept
in interfaceJava.TypeBodyDeclaration
- Throws:
EX extends java.lang.Throwable
-
accept
@Nullable public abstract <R,EX extends java.lang.Throwable> R accept(Visitor.FunctionDeclaratorVisitor<R,EX> visitor) throws EX extends java.lang.Throwable
Invokes the "visit...()
" method ofVisitor.FunctionDeclaratorVisitor
for the concreteJava.FunctionDeclarator
type.- Throws:
EX extends java.lang.Throwable
-
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
-
setEnclosingScope
public void setEnclosingScope(Java.Scope enclosingScope)
Description copied from class:Java.AbstractTypeBodyDeclaration
Forward-implementsJava.BlockStatement.setEnclosingScope(Java.Scope)
.- Overrides:
setEnclosingScope
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
@Nullable public java.lang.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
-
isStrictfp
public boolean isStrictfp()
-
-