dk.brics.string.external
Interface Resolver

All Known Implementing Classes:
RuntimeResolver

public interface Resolver

Callback interface to allow the string analysis to model some external methods and fields more precisely.

A resolver is added to the current list of active resolvers by the StringAnalysis.addResolver method. Every time the analysis encounters a reference to a field or method which it does not know about, it will ask all active resolvers (in the order in which they were added) for information about the field or method.


Method Summary
 FieldResolution resolveField(FieldRef expr)
          Called by the string analysis when it encounters a reference of an unknown String field in a non-application class.
 MethodResolution resolveMethod(InvokeExpr expr, SootMethod target)
          Called by the string analysis when it encounters a call of an unknown method in a non-application class.
 

Method Detail

resolveField

FieldResolution resolveField(FieldRef expr)
Called by the string analysis when it encounters a reference of an unknown String field in a non-application class. Mutable fields in non-application classes cannot be resolved.

The resolver can return null to indicate that nothing special is known about the field. Otherwise, it can return a FieldResolution object describing the possible values of the field.

Parameters:
expr - the field reference.
Returns:
a description of the possible values, or null.
See Also:
FieldResolution

resolveMethod

MethodResolution resolveMethod(InvokeExpr expr,
                               SootMethod target)
Called by the string analysis when it encounters a call of an unknown method in a non-application class.

The resolver can return null to indicate that nothing special is known about the invoked method. Otherwise, it can return a MethodResolution object describing the behaviour of this method invocation.

Parameters:
expr - the invoke expression that calls the unknown method.
target - the unknown method.
Returns:
a description of the possible return values, or null.
See Also:
MethodResolution


Copyright © 2003-2009 Anders Møller, Aske Simon Christensen, Asger Feldthaus.