Interface IJavaFor
- All Superinterfaces:
IJavaCompound,IJavaElement,IJavaExpression,IJavaStatement
Java AST interface used to represent a standard for loop statement. A for loop is a pre-tested
loop, that consists of an initializer statement, a test predicate, a post-iteration statement,
and a body.
Example:
for(initializer; predicate; poststm) {
// body
}
-
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
FLAG_BUILT, FLAG_FIELD_REFERENCES_OUTERCLASS, FLAG_LAMBDA_CLASS, FLAG_LAMBDA_IMPL, FLAG_OPTIONAL_RENDERING, FLAG_SECOND_PARAMETER_IS_OUTER_REF, FLAG_STICKY -
Method Summary
Modifier and TypeMethodDescriptionDuplicate this element.getBody()Get the loop body.Get the initializer statement.Get the post-iteration statement.Get the loop predicate.voidSet the loop post-iteration statement.voidsetInitializer(IJavaStatement initializer) Set the loop initializer statement.voidsetPostStatement(IJavaStatement poststm) Set the loop post-iteration statement.voidSet the loop predicate.Methods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaCompound
generateFlatList, getBlocks, getSubElements, insertAt, resetMethods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaElement
addFlags, addTag, canCauseException, collectAllPhysicalOffsets, generate, getData, getElementType, getFlags, getOrigin, getPhysicalMethodIndex, getPhysicalOffset, getReconAnon, getReconEnum, getReconEnummap, getReconLambda, getSubElements, getTags, hasFlags, hasPhysicalMethodIndex, hasPhysicalOffset, isReconArtifact, removeFlags, removeTag, replaceSubElement, setData, setFlags, setLambdaRecon, setOrigin, setPhysicalMethodIndex, setPhysicalOffset, setReconAnon, setReconEnum, setReconEnummap, toShortString, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPost, visitDepthPre, visitDepthPre, visitDepthPreMethods inherited from interface com.pnfsoftware.jeb.core.units.code.java.IJavaStatement
getIntermediateOffset, setIntermediateOffset
-
Method Details
-
getInitializer
IJavaStatement getInitializer()Get the initializer statement.- Returns:
- the initializer statement, may be null
-
getPredicate
IJavaPredicate getPredicate()Get the loop predicate.- Returns:
- the loop predicate, may be null
-
getPostStatement
IJavaStatement getPostStatement()Get the post-iteration statement.- Returns:
- the post-iteration statement, may be null
-
getBody
IJavaBlock getBody()Get the loop body.- Returns:
- the loop body, never null
-
setInitializer
Set the loop initializer statement.- Parameters:
initializer- optional initializer
-
setPredicate
Set the loop predicate.- Parameters:
p- optional loop predicate
-
setPostStatement
Set the loop post-iteration statement.- Parameters:
poststm- optional post-iteration statement
-
setBody
Set the loop post-iteration statement.- Parameters:
b- mandatory loop body
-
duplicate
IJavaFor duplicate()Description copied from interface:IJavaElementDuplicate this element.- Specified by:
duplicatein interfaceIJavaCompound- Specified by:
duplicatein interfaceIJavaElement- Specified by:
duplicatein interfaceIJavaExpression- Specified by:
duplicatein interfaceIJavaStatement- Returns:
- a (possibly) duplicated object of the same type
-