janino.net

org.codehaus.janino
Class Java.Initializer

java.lang.Object
  extended by org.codehaus.janino.Java.Located
      extended by org.codehaus.janino.Java.AbstractTypeBodyDeclaration
          extended by org.codehaus.janino.Java.Initializer
All Implemented Interfaces:
Java.BlockStatement, Java.Locatable, Java.Scope, Java.TypeBodyDeclaration
Enclosing class:
Java

public static final class Java.Initializer
extends Java.AbstractTypeBodyDeclaration
implements Java.BlockStatement

Representation of an 'instance initializer' (JLS7 8.6) or 'static initializer' (JLS7 8.7).


Field Summary
 Java.Block block
          The block that poses the initializer.
 
Fields inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
statiC
 
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
 
Constructor Summary
Java.Initializer(Location location, boolean statiC, Java.Block block)
           
 
Method Summary
 void accept(Visitor.BlockStatementVisitor visitor)
          Invokes the 'visit...()' method of Visitor.BlockStatementVisitor for the concrete Java.BlockStatement type.
 void accept(Visitor.TypeBodyDeclarationVisitor visitor)
          Invokes the 'visit...()' method of Visitor.TypeBodyDeclarationVisitor for the concrete Java.TypeBodyDeclaration type.
 Java.LocalVariable findLocalVariable(String name)
           
 String toString()
           
 
Methods inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
getDeclaringType, getEnclosingScope, isStatic, setDeclaringType, setEnclosingScope
 
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.BlockStatement
getEnclosingScope, setEnclosingScope
 
Methods inherited from interface org.codehaus.janino.Java.Locatable
getLocation, throwCompileException
 

Field Detail

block

public final Java.Block block
The block that poses the initializer.

Constructor Detail

Java.Initializer

public Java.Initializer(Location location,
                        boolean statiC,
                        Java.Block block)
Method Detail

toString

public String toString()
Overrides:
toString in class Object

accept

public void accept(Visitor.TypeBodyDeclarationVisitor visitor)
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

accept

public void accept(Visitor.BlockStatementVisitor visitor)
Description copied from interface: Java.BlockStatement
Invokes the 'visit...()' method of Visitor.BlockStatementVisitor for the concrete Java.BlockStatement type.

Specified by:
accept in interface Java.BlockStatement

findLocalVariable

public Java.LocalVariable findLocalVariable(String name)
Specified by:
findLocalVariable in interface Java.BlockStatement
Returns:
The local variable with the given name

janino.net