FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba.bcp
Class PatternMatcher

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.bcp.PatternMatcher
All Implemented Interfaces:
DFSEdgeTypes

public class PatternMatcher
extends java.lang.Object
implements DFSEdgeTypes

Match a ByteCodePattern against the code of a method, represented by a CFG. Produces some number of ByteCodePatternMatch objects, which indicate how the pattern matched the bytecode instructions in the method.

This code is a hack and should probably be rewritten.

Author:
David Hovemeyer
See Also:
ByteCodePattern

Field Summary
 
Fields inherited from interface edu.umd.cs.findbugs.graph.DFSEdgeTypes
BACK_EDGE, CROSS_EDGE, FORWARD_EDGE, TREE_EDGE, UNKNOWN_EDGE
 
Constructor Summary
PatternMatcher(ByteCodePattern pattern, ClassContext classContext, org.apache.bcel.classfile.Method method)
          Constructor.
 
Method Summary
 java.util.Iterator<ByteCodePatternMatch> byteCodePatternMatchIterator()
          Return an Iterator over the ByteCodePatternMatch objects representing successful matches of the ByteCodePattern.
 PatternMatcher execute()
          Search for examples of the ByteCodePattern.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PatternMatcher

public PatternMatcher(ByteCodePattern pattern,
                      ClassContext classContext,
                      org.apache.bcel.classfile.Method method)
               throws CFGBuilderException,
                      DataflowAnalysisException
Constructor.

Parameters:
pattern - the ByteCodePattern to look for examples of
classContext - ClassContext for the class to analyze
method - the Method to analyze
Throws:
CFGBuilderException
DataflowAnalysisException
Method Detail

execute

public PatternMatcher execute()
                       throws DataflowAnalysisException
Search for examples of the ByteCodePattern.

Returns:
this object
Throws:
DataflowAnalysisException - if the ValueNumberAnalysis did not produce useful values for the method

byteCodePatternMatchIterator

public java.util.Iterator<ByteCodePatternMatch> byteCodePatternMatchIterator()
Return an Iterator over the ByteCodePatternMatch objects representing successful matches of the ByteCodePattern.


FindBugs™ 1.3.9

FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.