FindBugs™ 1.3.9

edu.umd.cs.findbugs.ba.ch
Class OverriddenMethodsVisitor

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.ch.OverriddenMethodsVisitor
All Implemented Interfaces:
InheritanceGraphVisitor
Direct Known Subclasses:
AbstractMethodAnnotationAccumulator

public abstract class OverriddenMethodsVisitor
extends java.lang.Object
implements InheritanceGraphVisitor

This class implements a best-effort visitation of all methods overridden by a given derived instance method. Objects extending this class can be used with the Subtypes2.traverseSupertypes(ClassDescriptor, InheritanceGraphVisitor) method.

Author:
David Hovemeyer

Constructor Summary
OverriddenMethodsVisitor(XMethod xmethod)
          Constructor.
 
Method Summary
 XMethod getXmethod()
           
 boolean visitClass(ClassDescriptor classDescriptor, XClass xclass)
          Visit a class vertex in the inheritance graph.
 boolean visitEdge(ClassDescriptor sourceDesc, XClass source, ClassDescriptor targetDesc, XClass target)
          Visit an inheritance edge in the inheritance graph.
protected abstract  boolean visitOverriddenMethod(XMethod xmethod)
          Downcall method: will be called for each method overridden by the derived method object passed to the constructor.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OverriddenMethodsVisitor

public OverriddenMethodsVisitor(XMethod xmethod)
Constructor.

Parameters:
xmethod - a derived method
Method Detail

getXmethod

public XMethod getXmethod()
Returns:
Returns the xmethod.

visitClass

public boolean visitClass(ClassDescriptor classDescriptor,
                          XClass xclass)
Description copied from interface: InheritanceGraphVisitor
Visit a class vertex in the inheritance graph.

Specified by:
visitClass in interface InheritanceGraphVisitor
Parameters:
classDescriptor - ClassDescriptor of the class vertex
xclass - XClass object containing information about the class; null if class cannot be resolved
Returns:
true if traversal should continue, false otherwise

visitEdge

public boolean visitEdge(ClassDescriptor sourceDesc,
                         XClass source,
                         ClassDescriptor targetDesc,
                         XClass target)
Description copied from interface: InheritanceGraphVisitor
Visit an inheritance edge in the inheritance graph.

Specified by:
visitEdge in interface InheritanceGraphVisitor
Parameters:
sourceDesc - ClassDescriptor of the source class (subtype)
source - XClass object containing information about source class
targetDesc - ClassDescriptor of the target class (supertype)
target - XClass object containing information about target class; null if class cannot be resolved
Returns:
true if traversal should continue, false otherwise

visitOverriddenMethod

protected abstract boolean visitOverriddenMethod(XMethod xmethod)
Downcall method: will be called for each method overridden by the derived method object passed to the constructor. Note that this method will be called for the original derived method, since this is useful for some applications.

Parameters:
xmethod - a method which is overridden by the original derived method, or is the original derived method
Returns:
true if the traversal should continue into superclasses, false otherwise

FindBugs™ 1.3.9

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