Package org.codehaus.janino

# Class Java.Statement

java.lang.Object
org.codehaus.janino.Java.Located
org.codehaus.janino.Java.Statement

All Implemented Interfaces:
  `Java.BlockStatement`, `Java.Locatable`, `Java.Scope`

Direct Known Subclasses:
  `Java.AssertStatement`, `Java.Block`, `Java.BreakableStatement`, `Java.BreakStatement`, `Java.ContinueStatement`, `Java.EmptyStatement`, `Java.ExpressionStatement`, `Java.FieldDeclaration`, `Java.IfStatement`, `Java.LocalClassDeclarationStatement`, `Java.LocalVariableDeclarationStatement`, `Java.ReturnStatement`, `Java.SynchronizedStatement`, `Java.ThrowStatement`, `Java.TryStatement`

Enclosing class:
  `Java`

public abstract static class Java.Statement extends Java.Located implements Java.BlockStatement
Everything that can occur in the body of a method or in a block. Particularly, explicit constructor invocations and initializers are not statements in this sense.

This class is misnamed; according to JLS7 8.8.7 and 14.2, its name should be "BlockStatement".

## Field Summary

Fields
Modifier and Type
Field
Description
`Map<String,Java.LocalVariable>`
`localVariables`
The map of currently visible local variables.

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

`NOWHERE`

## Constructor Summary

Constructors
Modifier
Constructor
Description
`protected`
`Statement(Location location)`

## Method Summary

Modifier and Type
Method
Description
`Java.LocalVariable`
`findLocalVariable(String name)`
`Java.Scope`
`getEnclosingScope()`
`void`
`setEnclosingScope(Java.Scope enclosingScope)`
Sets the enclosing scope of this `Java.BlockStatement`.

### 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.BlockStatement

`accept`

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

`getLocation, throwCompileException`

## Field Details

### localVariables

@Nullable public Map<String,Java.LocalVariable> localVariables
The map of currently visible local variables.

## Constructor Details

### Statement

protected Statement(Location location)

## Method Details

### setEnclosingScope

public void setEnclosingScope(Java.Scope enclosingScope)
Description copied from interface: `Java.BlockStatement`
Sets the enclosing scope of this `Java.BlockStatement`.

Specified by:
  `setEnclosingScope` in interface `Java.BlockStatement`

### getEnclosingScope

public Java.Scope getEnclosingScope()

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

### findLocalVariable

@Nullable public Java.LocalVariable findLocalVariable(String name)

Specified by:
  `findLocalVariable` in interface `Java.BlockStatement`
Returns:
  The local variable with the given name