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 for
Java.ConstructorDeclarator
and Java.MethodDeclarator
.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final class
Representation of a (formal) function parameter.static final class
Representation of the (formal) function parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final String
The parameters of the function.Mapping of variable names toJava.LocalVariable
s.final String
The name of the function ("<init>"
for constructors).(package private) IType
Set by "compile()".final List
<? extends Java.BlockStatement> The statements that comprise the function;null
for abstract method declarations.final Java.Type[]
The types of the declared exceptions.final Java.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
ConstructorsConstructorDescriptionFunctionDeclarator
(Location location, String docComment, Java.Modifier[] modifiers, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, List<? extends Java.BlockStatement> statements) -
Method Summary
Modifier and TypeMethodDescriptionabstract <R,
EX extends Throwable>
Raccept
(Visitor.FunctionDeclaratorVisitor<R, EX> visitor) Invokes the "visit...()
" method ofVisitor.FunctionDeclaratorVisitor
for the concreteJava.FunctionDeclarator
type.final <R,
EX extends Throwable>
Raccept
(Visitor.TypeBodyDeclarationVisitor<R, EX> visitor) Invokes the "visit...()
" method ofVisitor.TypeBodyDeclarationVisitor
for the concreteJava.TypeBodyDeclaration
type.boolean
Returnstrue
if the object has a doc comment and the@deprecated
tag appears in the doc comment.boolean
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 Details
-
docComment
-
type
The return type of the function (VOID for constructors). -
name
The name of the function ("<init>"
for constructors). -
formalParameters
The parameters of the function. -
thrownExceptions
The types of the declared exceptions. -
statements
The statements that comprise the function;null
for abstract method declarations. -
returnType
Set by "compile()". -
localVariables
Mapping of variable names toJava.LocalVariable
s.
-
-
Constructor Details
-
FunctionDeclarator
public FunctionDeclarator(Location location, @Nullable String docComment, Java.Modifier[] modifiers, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, @Nullable List<? extends Java.BlockStatement> statements)
-
-
Method Details
-
getAccess
-
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 Throwable> R accept(Visitor.TypeBodyDeclarationVisitor<R, EX> visitor) throws EXDescription copied from interface:Java.TypeBodyDeclaration
Invokes the "visit...()
" method ofVisitor.TypeBodyDeclarationVisitor
for the concreteJava.TypeBodyDeclaration
type.- Specified by:
accept
in interfaceJava.TypeBodyDeclaration
- Throws:
EX
-
accept
@Nullable public abstract <R,EX extends Throwable> R accept(Visitor.FunctionDeclaratorVisitor<R, EX> visitor) throws EXInvokes the "visit...()
" method ofVisitor.FunctionDeclaratorVisitor
for the concreteJava.FunctionDeclarator
type.- Throws:
EX
-
setDeclaringType
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
Description copied from class:Java.AbstractTypeBodyDeclaration
Forward-implementsJava.BlockStatement.setEnclosingScope(Java.Scope)
.- Overrides:
setEnclosingScope
in classJava.AbstractTypeBodyDeclaration
-
getEnclosingScope
- Specified by:
getEnclosingScope
in interfaceJava.Scope
- Overrides:
getEnclosingScope
in classJava.AbstractTypeBodyDeclaration
- Returns:
- The scope that encloses this scope, or
null
-
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()
-