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.FieldDeclarationOrInitializer
,Java.Locatable
,Java.Scope
,Java.TypeBodyDeclaration
- Enclosing class:
- Java
public static final class Java.Initializer
extends Java.AbstractTypeBodyDeclaration
implements Java.FieldDeclarationOrInitializer
Representation of an "instance initializer" (JLS7 8.6) or "static initializer" (JLS7 8.7).
-
Field Summary
FieldsFields inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
modifiers
Fields inherited from class org.codehaus.janino.Java.Located
NOWHERE
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R,
EX extends Throwable>
Raccept
(Visitor.BlockStatementVisitor<R, EX> visitor) Invokes the "visit...()
" method ofVisitor.BlockStatementVisitor
for the concreteJava.BlockStatement
type.<R,
EX extends Throwable>
Raccept
(Visitor.FieldDeclarationOrInitializerVisitor<R, EX> visitor) <R,
EX extends Throwable>
Raccept
(Visitor.TypeBodyDeclarationVisitor<R, EX> visitor) Invokes the "visit...()
" method ofVisitor.TypeBodyDeclarationVisitor
for the concreteJava.TypeBodyDeclaration
type.findLocalVariable
(String name) boolean
isStatic()
toString()
Methods inherited from class org.codehaus.janino.Java.AbstractTypeBodyDeclaration
getAnnotations, getDeclaringType, getEnclosingScope, getModifiers, 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
Methods inherited from interface org.codehaus.janino.Java.TypeBodyDeclaration
getDeclaringType, getModifiers, setDeclaringType
-
Field Details
-
block
The block that poses the initializer.
-
-
Constructor Details
-
Initializer
-
-
Method Details
-
isStatic
public boolean isStatic() -
toString
-
accept
@Nullable public <R,EX extends Throwable> R accept(Visitor.FieldDeclarationOrInitializerVisitor<R, EX> visitor) throws EX- Specified by:
accept
in interfaceJava.FieldDeclarationOrInitializer
- Throws:
EX extends Throwable
-
accept
@Nullable public <R,EX extends Throwable> R accept(Visitor.TypeBodyDeclarationVisitor<R, EX> visitor) throws EXDescription copied from interface:Java.TypeBodyDeclaration
Invokes the "visit...()
" method ofVisitor.TypeBodyDeclarationVisitor
for the concreteJava.TypeBodyDeclaration
type.- Specified by:
accept
in interfaceJava.TypeBodyDeclaration
- Throws:
EX extends Throwable
-
accept
@Nullable public <R,EX extends Throwable> R accept(Visitor.BlockStatementVisitor<R, EX> visitor) throws EXDescription copied from interface:Java.BlockStatement
Invokes the "visit...()
" method ofVisitor.BlockStatementVisitor
for the concreteJava.BlockStatement
type.- Specified by:
accept
in interfaceJava.BlockStatement
- Throws:
EX extends Throwable
-
findLocalVariable
- Specified by:
findLocalVariable
in interfaceJava.BlockStatement
- Returns:
- The local variable with the given name
-