|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.umd.cs.findbugs.ba.bcp.PatternElement
edu.umd.cs.findbugs.ba.bcp.MatchAny
public class MatchAny
A "meta" PatternElement that matches any of a list of other child PatternElements. An example of how this is useful is that you might want to match invocations of any of a number of different methods. To do this, you can create a MatchAny with some number of Invoke elements as children.
Note that the minOccur() and maxOccur() counts of the child PatternElements are ignored. A MatchAny element always matches exactly one instruction.
PatternElement
Constructor Summary | |
---|---|
MatchAny(PatternElement[] childList)
Constructor. |
Method Summary | |
---|---|
boolean |
acceptBranch(Edge edge,
org.apache.bcel.generic.InstructionHandle source)
Return whether or not it is acceptable to take the given branch. |
PatternElement |
label(java.lang.String label)
Set a label for this PatternElement. |
MatchResult |
match(org.apache.bcel.generic.InstructionHandle handle,
org.apache.bcel.generic.ConstantPoolGen cpg,
ValueNumberFrame before,
ValueNumberFrame after,
BindingSet bindingSet)
Return whether or not this element matches the given instruction with the given Bindings in effect. |
int |
maxOccur()
Return the maximum number of instructions this PatternElement must match in the ByteCodePattern. |
int |
minOccur()
Return the minimum number of instructions this PatternElement must match in the ByteCodePattern. |
PatternElement |
setAllowTrailingEdges(boolean allowTrailingEdges)
Set whether or not this PatternElement allows trailing edges to be matched. |
Methods inherited from class edu.umd.cs.findbugs.ba.bcp.PatternElement |
---|
addOrCheckDefinition, allowTrailingEdges, dominatedBy, getDominatedBy, getLabel, getNext, lookup, setIndex, setNext, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public MatchAny(PatternElement[] childList)
childList
- list of child PatternElementsMethod Detail |
---|
public PatternElement label(java.lang.String label)
PatternElement
label
in class PatternElement
label
- the label
public PatternElement setAllowTrailingEdges(boolean allowTrailingEdges)
PatternElement
setAllowTrailingEdges
in class PatternElement
allowTrailingEdges
- true if trailing edges may be matched,
false if trailing edges will never be matchedpublic MatchResult match(org.apache.bcel.generic.InstructionHandle handle, org.apache.bcel.generic.ConstantPoolGen cpg, ValueNumberFrame before, ValueNumberFrame after, BindingSet bindingSet) throws DataflowAnalysisException
PatternElement
match
in class PatternElement
handle
- the instructioncpg
- the ConstantPoolGen from the methodbefore
- the ValueNumberFrame representing values in the Java stack frame
just before the execution of the instructionafter
- the ValueNumberFrame representing values in the Java stack frame
just after the execution of the instructionbindingSet
- the set of Bindings
DataflowAnalysisException
public boolean acceptBranch(Edge edge, org.apache.bcel.generic.InstructionHandle source)
PatternElement
acceptBranch
in class PatternElement
edge
- the Edge representing the branchsource
- the source instruction of the branch
public int minOccur()
PatternElement
minOccur
in class PatternElement
public int maxOccur()
PatternElement
maxOccur
in class PatternElement
|
FindBugs™ 1.3.9 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |