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 Classes
Modifier and Type
Class
Description
`static final class`
`Java.FunctionDeclarator.FormalParameter`
Representation of a (formal) function parameter.
`static final class`
`Java.FunctionDeclarator.FormalParameters`
Representation of the (formal) function parameters.

## Field Summary

Fields
Modifier and Type
Field
Description
`final Java.FunctionDeclarator.FormalParameters`
`formalParameters`
The parameters of the function.
`Map<String,Java.LocalVariable>`
`localVariables`
Mapping of variable names to `Java.LocalVariable`s.
`final String`
`name`
The name of the function (`"<init>"` for constructors).
`final List<? extends Java.BlockStatement>`
`statements`
The statements that comprise the function; `null` for abstract method declarations.
`final Java.Type[]`
`thrownExceptions`
The types of the declared exceptions.
`final 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, 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 Type
Method
Description
`abstract <R, EX extends Throwable>
R`
`accept(Visitor.FunctionDeclaratorVisitor<R,EX> visitor)`
Invokes the "`visit...()`" method of `Visitor.FunctionDeclaratorVisitor` for the concrete `Java.FunctionDeclarator` type.
`final <R, EX extends Throwable>
R`
`accept(Visitor.TypeBodyDeclarationVisitor<R,EX> visitor)`
Invokes the "`visit...()`" method of `Visitor.TypeBodyDeclarationVisitor` for the concrete `Java.TypeBodyDeclaration` type.
`Access`
`getAccess()`
`Java.Annotation[]`
`getAnnotations()`
`String`
`getDocComment()`
`Java.Scope`
`getEnclosingScope()`
`boolean`
`hasDeprecatedDocTag()`
Returns `true` if the object has a doc comment and the `&#64;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-implements `Java.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

### 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 (`"<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 List<? extends Java.BlockStatement> statements
The statements that comprise the function; `null` for abstract method declarations.

### localVariables

@Nullable public Map<String,Java.LocalVariable> localVariables
Mapping of variable names to `Java.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

public Access getAccess()

### getAnnotations

public Java.Annotation[] getAnnotations()

Specified by:
  `getAnnotations` in interface `Java.Annotatable`
Overrides:
  `getAnnotations` in class `Java.AbstractTypeBodyDeclaration`
Returns:
  The annotations of this function

### accept

@Nullable public final <R, EX extends Throwable> R accept(Visitor.TypeBodyDeclarationVisitor<R,EX> visitor) throws EX
Description copied from interface: `Java.TypeBodyDeclaration`
Invokes the "`visit...()`" method of `Visitor.TypeBodyDeclarationVisitor` for the concrete `Java.TypeBodyDeclaration` type.

Specified by:
  `accept` in interface `Java.TypeBodyDeclaration`
Throws:
  `EX`

### accept

@Nullable public abstract <R, EX extends Throwable> R accept(Visitor.FunctionDeclaratorVisitor<R,EX> visitor) throws EX
Invokes the "`visit...()`" method of `Visitor.FunctionDeclaratorVisitor` for the concrete `Java.FunctionDeclarator` type.

Throws:
  `EX`

### 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 interface `Java.TypeBodyDeclaration`
Overrides:
  `setDeclaringType` in class `Java.AbstractTypeBodyDeclaration`

### setEnclosingScope

public void setEnclosingScope(Java.Scope enclosingScope)
Description copied from class: `Java.AbstractTypeBodyDeclaration`
Forward-implements `Java.BlockStatement.setEnclosingScope(Java.Scope)`.

Overrides:
  `setEnclosingScope` in class `Java.AbstractTypeBodyDeclaration`

### getEnclosingScope

public Java.Scope getEnclosingScope()

Specified by:
  `getEnclosingScope` in interface `Java.Scope`
Overrides:
  `getEnclosingScope` in class `Java.AbstractTypeBodyDeclaration`
Returns:
  The scope that encloses this scope, or `null`

### getDocComment

@Nullable public String getDocComment()

Specified by:
  `getDocComment` in interface `Java.DocCommentable`
Returns:
  The doc comment of the object or `null`

### hasDeprecatedDocTag

public boolean hasDeprecatedDocTag()
Description copied from interface: `Java.DocCommentable`
Returns `true` if the object has a doc comment and the `&#64;deprecated` tag appears in the doc comment.

Specified by:
  `hasDeprecatedDocTag` in interface `Java.DocCommentable`

### isStrictfp

public boolean isStrictfp()