Package org.codehaus.janino

# Class Java.MethodDeclarator

java.lang.Object
org.codehaus.janino.Java.Located
org.codehaus.janino.Java.AbstractTypeBodyDeclaration
org.codehaus.janino.Java.FunctionDeclarator
org.codehaus.janino.Java.MethodDeclarator

All Implemented Interfaces:
  `Java.Annotatable`, `Java.DocCommentable`, `Java.Locatable`, `Java.Scope`, `Java.TypeBodyDeclaration`

Enclosing class:
  `Java`

public static final class Java.MethodDeclarator extends Java.FunctionDeclarator
Representation of a method declarator.

## Nested Class Summary

## Nested classes/interfaces inherited from class org.codehaus.janino.Java.FunctionDeclarator

`Java.FunctionDeclarator.FormalParameter, Java.FunctionDeclarator.FormalParameters`

## Field Summary

Fields
Modifier and Type
Field
Description
`Java.ElementValue`
`defaultValue`
The optional "default value" of the declared method (only methods of annotation types can have a default value).
`final Java.TypeParameter[]`
`typeParameters`
The type parameters declared for the method.

### Fields inherited from class org.codehaus.janino.Java.FunctionDeclarator

`formalParameters, localVariables, name, statements, thrownExceptions, type`

### 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
`MethodDeclarator(Location location, String docComment, Java.Modifier[] modifiers, Java.TypeParameter[] typeParameters, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, Java.ElementValue defaultValue, List<? extends Java.BlockStatement> statements)`

## Method Summary

Modifier and Type
Method
Description
`<R, EX extends Throwable>
R`
`accept(Visitor.FunctionDeclaratorVisitor<R,EX> visitor)`
Invokes the "`visit...()`" method of `Visitor.FunctionDeclaratorVisitor` for the concrete `Java.FunctionDeclarator` type.
`boolean`
`isAbstract()`
`boolean`
`isDefault()`
`boolean`
`isFinal()`
`boolean`
`isNative()`
`boolean`
`isStatic()`
`boolean`
`isSynchronized()`
`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)`.
`String`
`toString()`

### Methods inherited from class org.codehaus.janino.Java.FunctionDeclarator

`accept, getAccess, getAnnotations, getDocComment, getEnclosingScope, hasDeprecatedDocTag, isStrictfp`

### 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, wait, wait, wait`

### Methods inherited from interface org.codehaus.janino.Java.Locatable

`getLocation, throwCompileException`

## Field Details

### typeParameters

@Nullable public final Java.TypeParameter[] typeParameters
The type parameters declared for the method.

### defaultValue

@Nullable public Java.ElementValue defaultValue
The optional "default value" of the declared method (only methods of annotation types can have a default value).

## Constructor Details

### MethodDeclarator

public MethodDeclarator(Location location, @Nullable String docComment, Java.Modifier[] modifiers, @Nullable Java.TypeParameter[] typeParameters, Java.Type type, String name, Java.FunctionDeclarator.FormalParameters formalParameters, Java.Type[] thrownExceptions, @Nullable Java.ElementValue defaultValue, @Nullable List<? extends Java.BlockStatement> statements)

Parameters:
  `defaultValue` - See `defaultValue`

## Method Details

### 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.FunctionDeclarator`

### 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.FunctionDeclarator`

### toString

public String toString()

Overrides:
  `toString` in class `Object`

### accept

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

Specified by:
  `accept` in class `Java.FunctionDeclarator`
Throws:
  `EX`

### isStatic

public boolean isStatic()

### isDefault

public boolean isDefault()

### isAbstract

public boolean isAbstract()

### isNative

public boolean isNative()

### isFinal

public boolean isFinal()

### isSynchronized

public boolean isSynchronized()