Package org.codehaus.janino

# Class Java.TryStatement.Resource

java.lang.Object
org.codehaus.janino.Java.Located
org.codehaus.janino.Java.TryStatement.Resource

All Implemented Interfaces:
  `Java.Locatable`

Direct Known Subclasses:
  `Java.TryStatement.LocalVariableDeclaratorResource`, `Java.TryStatement.VariableAccessResource`

Enclosing class:
  `Java.TryStatement`

public abstract static class Java.TryStatement.Resource extends Java.Located
Representation of a JLS9 14.20.2 "resource" in a TRY-with-resources statement.

## Field Summary

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

`NOWHERE`

## Constructor Summary

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

## Method Summary

Modifier and Type
Method
Description
`abstract <R, EX extends Throwable>
R`
`accept(Visitor.TryStatementResourceVisitor<R,EX> visitor)`
Invokes the "`visit...()`" method of `Visitor.TryStatementResourceVisitor` for the concrete `Java.TryStatement.Resource` type.
`abstract void`
`setEnclosingTryStatement(Java.TryStatement tryStatement)`
Sets the enclosing scope for this object and all subordinate `Java.TryStatement.Resource` objects.

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

## Constructor Details

### Resource

protected Resource(Location location)

## Method Details

### setEnclosingTryStatement

public abstract void setEnclosingTryStatement(Java.TryStatement tryStatement)
Sets the enclosing scope for this object and all subordinate `Java.TryStatement.Resource` objects.

### accept

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

Throws:
  `EX`