Package com.sun.codemodel
Class JForEach
- java.lang.Object
-
- com.sun.codemodel.JForEach
-
- All Implemented Interfaces:
JStatement
public final class JForEach extends java.lang.Object implements JStatement
ForEach Statement This will generate the code for statement based on the new j2se 1.5 j.l.s.
-
-
Field Summary
Fields Modifier and Type Field Description private JBlock
body
private JExpression
collection
private JVar
loopVar
private JType
type
private java.lang.String
var
-
Constructor Summary
Constructors Constructor Description JForEach(JType vartype, java.lang.String variable, JExpression collection)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JBlock
body()
void
state(JFormatter f)
JVar
var()
Returns a reference to the loop variable.
-
-
-
Field Detail
-
type
private final JType type
-
var
private final java.lang.String var
-
body
private JBlock body
-
collection
private final JExpression collection
-
loopVar
private final JVar loopVar
-
-
Constructor Detail
-
JForEach
public JForEach(JType vartype, java.lang.String variable, JExpression collection)
-
-
Method Detail
-
var
public JVar var()
Returns a reference to the loop variable.
-
body
public JBlock body()
-
state
public void state(JFormatter f)
- Specified by:
state
in interfaceJStatement
-
-