Package org.codehaus.janino
Class Java.Initializer
- java.lang.Object
-
- org.codehaus.janino.Java.Located
-
- org.codehaus.janino.Java.AbstractTypeBodyDeclaration
-
- 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
Fields Modifier and Type Field Description Java.BlockblockThe 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
Constructors Constructor Description Initializer(Location location, boolean statiC, Java.Block block)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaccept(Visitor.BlockStatementVisitor visitor)Invokes the 'visit...()' method ofVisitor.BlockStatementVisitorfor the concreteJava.BlockStatementtype.voidaccept(Visitor.TypeBodyDeclarationVisitor visitor)Invokes the 'visit...()' method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.Java.LocalVariablefindLocalVariable(String name)StringtoString()-
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
-
Initializer
public Initializer(Location location, boolean statiC, Java.Block block)
-
-
Method Detail
-
accept
public void accept(Visitor.TypeBodyDeclarationVisitor visitor)
Description copied from interface:Java.TypeBodyDeclarationInvokes the 'visit...()' method ofVisitor.TypeBodyDeclarationVisitorfor the concreteJava.TypeBodyDeclarationtype.- Specified by:
acceptin interfaceJava.TypeBodyDeclaration
-
accept
public void accept(Visitor.BlockStatementVisitor visitor)
Description copied from interface:Java.BlockStatementInvokes the 'visit...()' method ofVisitor.BlockStatementVisitorfor the concreteJava.BlockStatementtype.- Specified by:
acceptin interfaceJava.BlockStatement
-
findLocalVariable
public Java.LocalVariable findLocalVariable(String name)
- Specified by:
findLocalVariablein interfaceJava.BlockStatement- Returns:
- The local variable with the given
name
-
-