edu.umd.cs.findbugs.visitclass

Class PreorderVisitor

public abstract class PreorderVisitor extends BetterVisitor implements Constants2

Interface to make the use of a visitor pattern programming style possible. I.e. a class that implements this interface can traverse the contents of a Java class just by calling the `accept' method which all classes have.

Implemented by wish of Boris Bokowski.

If don't like it, blame him. If you do like it thank me 8-)

Version: 970819

Author: M. Dahm

Method Summary
protected intasUnsignedByte(byte b)
voiddoVisitMethod(Method method)
StringgetClassName()
Get the slash-formatted class name for the current or most recently visited class
CodegetCode()
Return the current Code attribute; assuming one is being visited
ConstantPoolgetConstantPool()
Get the constant pool for the current or most recently visited class
StringgetDottedClassName()
Get the dotted class name for the current or most recently visited class
StringgetDottedMethodSig()
If currently visiting a method, get the method's dotted method signature
StringgetDottedSuperclassName()
Get the dotted superclass name for the current or most recently visited class
FieldgetField()
If currently visiting a method, get the method's Method object
booleangetFieldIsStatic()
If currently visiting a field, return whether or not the field is static
StringgetFieldName()
If currently visiting a field, get the field's name
StringgetFieldSig()
If currently visiting a field, get the field's slash-formatted signature
StringgetFullyQualifiedFieldName()
If currently visiting a field, get the field's fully qualified name
StringgetFullyQualifiedMethodName()
If currently visiting a method, get the method's fully qualified name
MethodgetMethod()
If currently visiting a method, get the method's Method object
StringgetMethodName()
If currently visiting a method, get the method's name
StringgetMethodSig()
If currently visiting a method, get the method's slash-formatted signature
static intgetNumberArguments(String signature)
intgetNumberMethodArguments()
StringgetPackageName()
Get the (slash-formatted?)
intgetSizeOfSurroundingTryBlock(int pc)
Get lines of code in try block that surround pc
intgetSizeOfSurroundingTryBlock(String vmNameOfExceptionClass, int pc)
Get lines of code in try block that surround pc
StringgetSourceFile()
Get the source file name for the current or most recently visited class
protected StringgetStringFromIndex(int i)
StringgetSuperclassName()
Get the slash-formatted superclass name for the current or most recently visited class
Set<String>getSurroundingCaughtExceptions(int pc)
JavaClassgetThisClass()
Get the JavaClass object for the current or most recently visited class
voidsetupVisitorForClass(JavaClass obj)
voidvisitAfter(JavaClass obj)
booleanvisitingField()
is the visitor currently visiting a field?
booleanvisitingMethod()
is the visitor currently visiting a method?

Method Detail

asUnsignedByte

protected int asUnsignedByte(byte b)

doVisitMethod

public void doVisitMethod(Method method)

getClassName

public String getClassName()
Get the slash-formatted class name for the current or most recently visited class

getCode

public Code getCode()
Return the current Code attribute; assuming one is being visited

Returns: current code attribute

getConstantPool

public ConstantPool getConstantPool()
Get the constant pool for the current or most recently visited class

getDottedClassName

public String getDottedClassName()
Get the dotted class name for the current or most recently visited class

getDottedMethodSig

public String getDottedMethodSig()
If currently visiting a method, get the method's dotted method signature

getDottedSuperclassName

public String getDottedSuperclassName()
Get the dotted superclass name for the current or most recently visited class

getField

public Field getField()
If currently visiting a method, get the method's Method object

getFieldIsStatic

public boolean getFieldIsStatic()
If currently visiting a field, return whether or not the field is static

getFieldName

public String getFieldName()
If currently visiting a field, get the field's name

getFieldSig

public String getFieldSig()
If currently visiting a field, get the field's slash-formatted signature

getFullyQualifiedFieldName

public String getFullyQualifiedFieldName()
If currently visiting a field, get the field's fully qualified name

getFullyQualifiedMethodName

public String getFullyQualifiedMethodName()
If currently visiting a method, get the method's fully qualified name

getMethod

public Method getMethod()
If currently visiting a method, get the method's Method object

getMethodName

public String getMethodName()
If currently visiting a method, get the method's name

getMethodSig

public String getMethodSig()
If currently visiting a method, get the method's slash-formatted signature

getNumberArguments

public static int getNumberArguments(String signature)

getNumberMethodArguments

public int getNumberMethodArguments()

getPackageName

public String getPackageName()
Get the (slash-formatted?) package name for the current or most recently visited class

getSizeOfSurroundingTryBlock

public int getSizeOfSurroundingTryBlock(int pc)
Get lines of code in try block that surround pc

Parameters: pc

Returns: number of lines of code in try block

getSizeOfSurroundingTryBlock

public int getSizeOfSurroundingTryBlock(String vmNameOfExceptionClass, int pc)
Get lines of code in try block that surround pc

Parameters: pc

Returns: number of lines of code in try block

getSourceFile

public String getSourceFile()
Get the source file name for the current or most recently visited class

getStringFromIndex

protected String getStringFromIndex(int i)

getSuperclassName

public String getSuperclassName()
Get the slash-formatted superclass name for the current or most recently visited class

getSurroundingCaughtExceptions

public Set<String> getSurroundingCaughtExceptions(int pc)

getThisClass

public JavaClass getThisClass()
Get the JavaClass object for the current or most recently visited class

setupVisitorForClass

public void setupVisitorForClass(JavaClass obj)

visitAfter

public void visitAfter(JavaClass obj)

visitingField

public boolean visitingField()
is the visitor currently visiting a field?

visitingMethod

public boolean visitingMethod()
is the visitor currently visiting a method?
FindBugs™ is licenced under the LGPL. Copyright © 2006 University of Maryland.