AST
node type ResourceDeclaration

General Info

Production
ResourceDeclaration : VariableDeclaration;
Type Hierarchy:
java.lang.Object
  extended by beaver.Symbol
      extended by AST.ASTNode<ASTNode>
          extended by AST.Stmt
              extended by AST.VariableDeclaration
                  extended by AST.ResourceDeclaration
All Implemented Interfaces:
SimpleSet, Variable, java.lang.Cloneable, java.lang.Iterable<ASTNode>, java.util.Iterator

Nested classes/interfaces inherited from interface AST.SimpleSet

Description

A resource declaration in a try with resources statement.
Source
Declared in Java7Frontend/TryWithResources.ast at line 9

Member Filters

API level:

Aspect:

Constructors

public ResourceDeclaration(Modifiers p0,
                           Access p1,
                           java.lang.String p2,
                           Opt<Expr> p3)
 
public ResourceDeclaration(Modifiers p0,
                           Access p1,
                           beaver.Symbol p2,
                           Opt<Expr> p3)
 

Attributes

inh TypeDecl lookupType(java.lang.String packageName,
                    java.lang.String typeName)
Inherit the lookupType attribute in ResourceDeclaration.
Overrides:lookupType in class Stmt
Source
Declared in Java7Frontend/TryWithResources.jrag at line 18
Aspect
TryWithResources

Methods

public void flushCache()
Overrides:flushCache in class VariableDeclaration
public ResourceDeclaration clone()
                          throws java.lang.CloneNotSupportedException
Overrides:clone in class VariableDeclaration
Throws:
java.lang.CloneNotSupportedException
Overrides:copy in class VariableDeclaration
Create a deep copy of the AST subtree at this node. The copy is dangling, i.e. has no parent.
Overrides:fullCopy in class VariableDeclaration
Returns:
dangling copy of the subtree at this node
public void typeCheck()
Type checking for TWR.
Overrides:typeCheck in class VariableDeclaration
Source
Declared in Java7Frontend/TryWithResources.jrag at line 23
Aspect
TryWithResources
public void nameCheck()
Overrides:nameCheck in class VariableDeclaration
Source
Declared in Java7Frontend/TryWithResources.jrag at line 156
Aspect
TryWithResources
public void init$Children()
Initializes the child array to the correct size. Initializes List and Opt nta children.
Overrides:init$Children in class VariableDeclaration
protected int numChildren()
Overrides:numChildren in class VariableDeclaration
public boolean mayHaveRewrite()
Overrides:mayHaveRewrite in class VariableDeclaration
public void setModifiers(Modifiers node)
Replaces the Modifiers child.
Overrides:setModifiers in class VariableDeclaration
Parameters:
node - The new node to replace the Modifiers child.
Retrieves the Modifiers child.
Specified by:getModifiers in interface VariableOverrides:getModifiers in class VariableDeclaration
Returns:
The current node used as the Modifiers child.
Retrieves the Modifiers child.

This method does not invoke AST transformations.

Overrides:getModifiersNoTransform in class VariableDeclaration
Returns:
The current node used as the Modifiers child.
public void setTypeAccess(Access node)
Replaces the TypeAccess child.
Overrides:setTypeAccess in class VariableDeclaration
Parameters:
node - The new node to replace the TypeAccess child.
Retrieves the TypeAccess child.
Overrides:getTypeAccess in class VariableDeclaration
Returns:
The current node used as the TypeAccess child.
Retrieves the TypeAccess child.

This method does not invoke AST transformations.

Overrides:getTypeAccessNoTransform in class VariableDeclaration
Returns:
The current node used as the TypeAccess child.
public void setID(java.lang.String value)
Replaces the lexeme ID.
Overrides:setID in class VariableDeclaration
Parameters:
value - The new value for the lexeme ID.
public void setID(beaver.Symbol symbol)
JastAdd-internal setter for lexeme ID using the Beaver parser.
Overrides:setID in class VariableDeclaration
public java.lang.String getID()
Retrieves the value for the lexeme ID.
Overrides:getID in class VariableDeclaration
Returns:
The value for the lexeme ID.
public void setInitOpt(Opt<Expr> opt)
Replaces the optional node for the Init child. This is the Opt node containing the child Init, not the actual child!
Overrides:setInitOpt in class VariableDeclaration
Parameters:
opt - The new node to be used as the optional node for the Init child.
public boolean hasInit()
Check whether the optional Init child exists.
Specified by:hasInit in interface VariableOverrides:hasInit in class VariableDeclaration
Returns:
true if the optional Init child exists, false if it does not.
public Expr getInit()
Retrieves the (optional) Init child.
Specified by:getInit in interface VariableOverrides:getInit in class VariableDeclaration
Returns:
The Init child, if it exists. Returns null otherwise.
public void setInit(Expr node)
Replaces the (optional) Init child.
Overrides:setInit in class VariableDeclaration
Parameters:
node - The new node to be used as the Init child.
public Opt<Expr> getInitOpt()
Overrides:getInitOpt in class VariableDeclaration
Retrieves the optional node for child Init. This is the Opt node containing the child Init, not the actual child!

This method does not invoke AST transformations.

Overrides:getInitOptNoTransform in class VariableDeclaration
Returns:
The optional node for child Init.
Overrides:Define_NameType_nameType in class VariableDeclaration
Source
Declared in Java7Frontend/TryWithResources.jrag at line 13
Overrides:rewriteTo in class VariableDeclaration

Inherited Members

Attributes inherited from AST.VariableDeclaration

Attributes inherited from AST.Stmt

Attributes inherited from AST.ASTNode

Methods inherited from class AST.VariableDeclaration

Methods inherited from class AST.Stmt

Methods inherited from class AST.ASTNode

Methods inherited from class beaver.Symbol

getColumn
getEnd
getId
getLine
getStart
makePosition

Methods inherited from class java.lang.Object

equals
finalize
getClass
hashCode
notify
notifyAll
wait
wait
wait

Methods inherited from interface AST.SimpleSet

Methods inherited from interface AST.Variable

Fields inherited from AST.VariableDeclaration

Fields inherited from AST.Stmt

Fields inherited from AST.ASTNode

Fields inherited from beaver.Symbol

end
id
start
value

Fields inherited from interface AST.SimpleSet