F4FApp

java.lang.Object
  extended by com.ibm.appscan.frameworks.highlevelapi.F4FApp

public class F4FApp
extends java.lang.Object

Representation of an application, with methods to query various properties of classes, methods, etc. Implemented mostly by delegating to methods from the T.J. Watson™ Libraries for Analysis (WALA); the goal is to consolidate the most useful WALA methods in a single type. See the WALA home page (http://wala.sourceforge.net) for full details on WALA APIs.

Constructor Detail

public F4FApp(IClassHierarchy cha)

Should not be needed to implement a new handler. The relevant F4FApp object will be passed as a parameter to F4FHandler.handleApp(F4FApp, F4FActions)

getAppClass

@Deprecated
public IClass getAppClass(java.lang.String vdbClassName)

Deprecated. Use getIClass(String) instead; this method simply delegates to that one.

getIClass

public IClass getIClass(java.lang.String vdbClassName)

get the IClass for some class in the application, including library jars/DLLs. If no class with the provided name is found, return null

Parameters:

  • vdbClassName - class name in VDB format, e.g., java.lang.String

getClassAnnotations

public java.util.Collection<Annotation> 
getClassAnnotations(IClass klass)

Get the annotations/attributes for a class. For .NET, the result will include inherited attributes.

Parameters:

  • klass - the class whose annotations are desired

getMethodAnnotations

public java.util.Collection<Annotation> 
getMethodAnnotations(IMethod method)

Get the annotations / attributes for a method. For .NET, these will include inherited attributes.

Parameters:

  • method - the method whose annotations are desired

getFieldAnnotations

public java.util.Collection<Annotation> 
getFieldAnnotations(IField field)

Get the annotations / attributes for a field.

Parameters:

  • field - the field whose annotations are desired

getMethodParametersAnnotations

public java.util.Collection<Annotation>[] 
getMethodParametersAnnotations(IMethod method)

Get annotations on parameters as an array of Collections, where each array element gives the annotations on the corresponding parameter. Note that the this parameter for an instance method cannot have annotations.

Parameters:

  • method - the method whose parameter annotations are desired

getAllApplicationClasses

public java.util.Collection<IClass> 
getAllApplicationClasses()

Get all the classes in the application (i.e., excluding those in library jars).

getClassHierarchy

public IClassHierarchy getClassHierarchy()

Get the WALA class hierarchy for the application. Most handlers should be able to work via the other methods in this class and shouldn't need to operate directly on the class hierarchy. But, access is provided for advanced use.

getMethodsDeclaredInClass

public java.util.Collection<IMethod> 
getMethodsDeclaredInClass(IClass klass)

Get all the static and instance methods declared in klass

getClassMethods

public java.util.Collection<IMethod> 
getClassMethods(java.lang.String className,
                java.lang.String methodName)

Get all the methods in an class with a particular name. If the class cannot be found, returns an empty Collection.

Parameters:

  • className - the class name in VDB (i.e., source-level) format, e.g., java.lang.String
  • methodName -

getClassMethods

public java.util.Collection<IMethod> 
getClassMethods(IClass appClass,
                java.lang.String methodName)

Get all the methods in an class with a particular name.

Parameters:

  • appClass - the class
  • methodName -

getStringConstantsReturnedByMethod

public java.util.Collection<java.lang.String> 
getStringConstantsReturnedByMethod(IMethod method)

Get the possible String constants returned by the method. E.g., if the method has a statement return "result";, then "result" will be in the returned Collection. Throws an IllegalArgumentException if the return type of method is not String.