Package edu.umd.cs.findbugs.ba.ch
Class OverriddenMethodsVisitor
- java.lang.Object
-
- edu.umd.cs.findbugs.ba.ch.OverriddenMethodsVisitor
-
- All Implemented Interfaces:
SupertypeTraversalVisitor
- Direct Known Subclasses:
AbstractMethodAnnotationAccumulator
public abstract class OverriddenMethodsVisitor extends java.lang.Object implements SupertypeTraversalVisitor
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 theSubtypes2.traverseSupertypes(ClassDescriptor, InheritanceGraphVisitor)
method.- Author:
- David Hovemeyer
-
-
Constructor Summary
Constructors Constructor Description OverriddenMethodsVisitor(XMethod xmethod)
Constructor.
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description XMethod
getXmethod()
boolean
visitClass(ClassDescriptor classDescriptor, XClass xclass)
Visit a class vertex 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.
-
-
-
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:SupertypeTraversalVisitor
Visit a class vertex in the inheritance graph. Only called for classes that could be resolved, not called for java.lang.Object.- Specified by:
visitClass
in interfaceSupertypeTraversalVisitor
- Parameters:
classDescriptor
- ClassDescriptor of the class vertexxclass
- XClass object containing information about the class; never null- 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
-
-