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 classRepresentation of a (formal) function parameter.static final classRepresentation of the (formal) function parameters. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final StringThe parameters of the function.Mapping of variable names toJava.LocalVariables.final StringThe name of the function ("<init>"for constructors).(package private) ITypeSet by "compile()".final List<? extends Java.BlockStatement> The statements that comprise the function;nullfor abstract method declarations.final Java.Type[]The types of the declared exceptions.final Java.TypeThe return type of the function (VOID for constructors).Fields inherited from class Java.AbstractTypeBodyDeclaration
modifiersFields inherited from class 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.FunctionDeclaratorVisitorfor the concreteJava.FunctionDeclaratortype.final <R, EX extends Throwable>
Raccept(Visitor.TypeBodyDeclarationVisitor<R, EX> visitor) Invokes the "visit...()" method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.booleanReturnstrueif the object has a doc comment and the@deprecatedtag appears in the doc comment.booleanvoidsetDeclaringType(Java.TypeDeclaration declaringType) Sets the type declaration that this declaration belongs to.voidsetEnclosingScope(Java.Scope enclosingScope) Forward-implementsJava.BlockStatement.setEnclosingScope(Java.Scope).Methods inherited from class Java.AbstractTypeBodyDeclaration
getDeclaringType, getModifiersMethods inherited from class Java.Located
getLocation, throwCompileExceptionMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface 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;nullfor abstract method declarations. -
returnType
-
localVariables
Mapping of variable names toJava.LocalVariables.
-
-
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:
getAnnotationsin interfaceJava.Annotatable- Overrides:
getAnnotationsin 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.TypeBodyDeclarationInvokes the "visit...()" method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.- Specified by:
acceptin 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.FunctionDeclaratorVisitorfor the concreteJava.FunctionDeclaratortype.- Throws:
EX
-
setDeclaringType
Description copied from interface:Java.TypeBodyDeclarationSets the type declaration that this declaration belongs to.- Specified by:
setDeclaringTypein interfaceJava.TypeBodyDeclaration- Overrides:
setDeclaringTypein classJava.AbstractTypeBodyDeclaration
-
setEnclosingScope
Description copied from class:Java.AbstractTypeBodyDeclarationForward-implementsJava.BlockStatement.setEnclosingScope(Java.Scope).- Overrides:
setEnclosingScopein classJava.AbstractTypeBodyDeclaration
-
getEnclosingScope
- Specified by:
getEnclosingScopein interfaceJava.Scope- Overrides:
getEnclosingScopein classJava.AbstractTypeBodyDeclaration- Returns:
- The scope that encloses this scope, or
null
-
getDocComment
- Specified by:
getDocCommentin interfaceJava.DocCommentable- Returns:
- The doc comment of the object or
null
-
hasDeprecatedDocTag
public boolean hasDeprecatedDocTag()Description copied from interface:Java.DocCommentableReturnstrueif the object has a doc comment and the@deprecatedtag appears in the doc comment.- Specified by:
hasDeprecatedDocTagin interfaceJava.DocCommentable
-
isStrictfp
public boolean isStrictfp()
-