public class ControlFlow extends Object
To obtain the control flow graph, do the following:
CtMethod m = ... ControlFlow cf = new ControlFlow(m); Block[] blocks = cf.basicBlocks();
blocks is an array of basic blocks in
 that method body.
CtMethod, 
ControlFlow.Block, 
Frame, 
Analyzer| Modifier and Type | Class and Description | 
|---|---|
| static class  | ControlFlow.BlockBasic block. | 
| static class  | ControlFlow.CatcherRepresents a catch clause. | 
| static class  | ControlFlow.NodeA node of (post) dominator trees. | 
| Constructor and Description | 
|---|
| ControlFlow(CtClass ctclazz,
           MethodInfo minfo)Constructs a control-flow analyzer. | 
| ControlFlow(CtMethod method)Constructs a control-flow analyzer for the given method. | 
| Modifier and Type | Method and Description | 
|---|---|
| ControlFlow.Block[] | basicBlocks()Returns all the basic blocks in the method body. | 
| ControlFlow.Node[] | dominatorTree()Constructs a dominator tree. | 
| Frame | frameAt(int pos)Returns the types of the local variables and stack frame entries
 available at the given position. | 
| ControlFlow.Node[] | postDominatorTree()Constructs a post dominator tree. | 
public ControlFlow(CtMethod method) throws BadBytecode
BadBytecodepublic ControlFlow(CtClass ctclazz, MethodInfo minfo) throws BadBytecode
BadBytecodepublic ControlFlow.Block[] basicBlocks()
public Frame frameAt(int pos) throws BadBytecode
pos - the position.BadBytecodepublic ControlFlow.Node[] dominatorTree()
 The order of the elements is the same as that
 of the elements in the Block array returned
 by the basicBlocks
 method.  If a Block object is at the i-th position
 in the Block array, then  
 the Node object referring to that
 Block object is at the i-th position in the
 array returned by this method.
 For every array element node, its index in the
 array is equivalent to node.block().index().
ControlFlow.Node.block(), 
ControlFlow.Block.index()public ControlFlow.Node[] postDominatorTree()
 The order of the elements is the same as that
 of the elements in the Block array returned
 by the basicBlocks
 method.  If a Block object is at the i-th position
 in the Block array, then  
 the Node object referring to that
 Block object is at the i-th position in the
 array returned by this method.
 For every array element node, its index in the
 array is equivalent to node.block().index().
ControlFlow.Node.block(), 
ControlFlow.Block.index()Copyright © 2016 Shigeru Chiba, www.javassist.org. All Rights Reserved.