edu.umd.cs.findbugs.ba
Class XFactory

java.lang.Object
  extended by edu.umd.cs.findbugs.ba.XFactory

public abstract class XFactory
extends java.lang.Object

Factory methods for creating XMethod objects.

Author:
David Hovemeyer

Constructor Summary
XFactory()
           
 
Method Summary
static XField createXField(org.apache.bcel.classfile.JavaClass javaClass, org.apache.bcel.classfile.Field field)
          Create an XField object from a BCEL Field.
static XField createXField(PreorderVisitor visitor)
          Create an XField object from the field currently being visited by the given PreorderVisitor.
static XField createXField(java.lang.String className, java.lang.String fieldName, java.lang.String fieldSignature, boolean isStatic, int accessFlags)
          Create an XField object
static XMethod createXMethod(org.apache.bcel.generic.InvokeInstruction invokeInstruction, org.apache.bcel.generic.ConstantPoolGen cpg)
          Create an XMethod object from an InvokeInstruction.
static XMethod createXMethod(org.apache.bcel.classfile.JavaClass javaClass, org.apache.bcel.classfile.Method method)
          Create an XMethod object from a BCEL Method.
static XMethod createXMethod(PreorderVisitor visitor)
          Create an XMethod object from the method currently being visited by the given PreorderVisitor.
static XMethod createXMethod(java.lang.String className, java.lang.String methodName, java.lang.String methodSig, boolean isStatic)
          Create an XMethod.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XFactory

public XFactory()
Method Detail

createXMethod

public static XMethod createXMethod(org.apache.bcel.classfile.JavaClass javaClass,
                                    org.apache.bcel.classfile.Method method)
Create an XMethod object from a BCEL Method.

Parameters:
javaClass - the class to which the Method belongs
method - the Method
Returns:
an XMethod representing the Method

createXField

public static XField createXField(java.lang.String className,
                                  java.lang.String fieldName,
                                  java.lang.String fieldSignature,
                                  boolean isStatic,
                                  int accessFlags)
Create an XField object

Parameters:
className -
fieldName -
fieldSignature -
isStatic -
accessFlags -
Returns:
the created XField

createXField

public static XField createXField(org.apache.bcel.classfile.JavaClass javaClass,
                                  org.apache.bcel.classfile.Field field)
Create an XField object from a BCEL Field.

Parameters:
javaClass - the JavaClass containing the field
field - the Field within the JavaClass
Returns:
the created XField

createXMethod

public static XMethod createXMethod(org.apache.bcel.generic.InvokeInstruction invokeInstruction,
                                    org.apache.bcel.generic.ConstantPoolGen cpg)
Create an XMethod object from an InvokeInstruction.

Parameters:
invokeInstruction - the InvokeInstruction
cpg - ConstantPoolGen from the class containing the instruction
Returns:
XMethod representing the method called by the InvokeInstruction

createXMethod

public static XMethod createXMethod(PreorderVisitor visitor)
Create an XMethod object from the method currently being visited by the given PreorderVisitor.

Parameters:
visitor - the PreorderVisitor
Returns:
the XMethod representing the method currently being visited

createXField

public static XField createXField(PreorderVisitor visitor)
Create an XField object from the field currently being visited by the given PreorderVisitor.

Parameters:
visitor - the PreorderVisitor
Returns:
the XField representing the method currently being visited

createXMethod

public static XMethod createXMethod(java.lang.String className,
                                    java.lang.String methodName,
                                    java.lang.String methodSig,
                                    boolean isStatic)
Create an XMethod. Note that the method access flags are set to a plausible, but not necessarily correct value.

Parameters:
className - class containing the method
methodName - method name
methodSig - method signature
isStatic - true if method is static, false if not
Returns:
the created XMethod