org.jtool.jxplatform.query
Class QueryMethod

java.lang.Object
  extended byorg.jtool.jxplatform.query.QueryMethod

public class QueryMethod
extends java.lang.Object

A utility class which provides quaries about methods. Do not pass null to any parameter in methods in this class.

Author:
katsuhisa Maruayma

Constructor Summary
QueryMethod()
           
 
Method Summary
static boolean callsMethodInAncestorsOfClass(JxMethod jmethod, JxClass jclass)
          Tests if a given method calls any method defined in ancestors of a given class.
static boolean callsMethodInAncestorsOfClassExceptSelf(JxMethod jmethod, JxClass jclass)
          Tests if a given method calls any method defined in ancestors of a given class except the method itself.
static boolean callsMethodInClassExceptSelf(JxMethod jmethod, JxClass jclass)
          Tests if a given method calls any method defined in a given class except the method itself.
static boolean callsMethodsInClass(JxMethod jmethod, JxClass jclass)
          Tests if a given method calls any method defined in a given class.
static boolean callsPrivateMethodInClass(JxMethod jmethod, JxClass jclass)
          Tests if a given method calls any private method in a given class.
static boolean callsPrivateMethodInClassExceptSelf(JxMethod jmethod, JxClass jclass)
          Tests if a given method calls any private method in a given class except the method itself.
static JxMethodList getApplicableMethodsInAncestors(JxMethod jmethod)
          Obtains all methods which are applicable to a given method in ancestors of a class defining the method.
static JxMethodList getApplicableMethodsInDescendants(JxMethod jmethod)
          Obtains all methods which are applicable to a given method in descendants of a class defining the method.
static JxMethodList getCalledMethodsInAncestorsOfClass(JxMethod jmethod, JxClass jclass)
          Obtains all methods in ancestors of a given class that are called by any method in a given method.
static JxMethodList getCalledMethodsInClass(JxMethod jmethod, JxClass jclass)
          Obtains all methods in a given class that are called by any method in a given method.
static JxMethodList getHiddenMethods(JxMethod jmethod)
          Obtains all methods hidden by a given method.
static JxMethodList getHiddenMethods(JxMethod jmethod, JxClassList ancestors)
          Obtains all methods hidden by a given method.
static JxMethodList getHidingMethods(JxMethod jmethod)
          Obtains all methods hiding a given method.
static JxMethodList getHidingMethods(JxMethod jmethod, JxClassList descendants)
          Obtains all methods hiding a given method.
static JxMethodList getIndirectlyImplementedMethods(JxMethod jmethod)
          Obtains all methods indirectly implemented by a given method.
static JxMethodList getIndirectlyImplementingMethods(JxMethod jmethod)
          Obtains all methods indirectly implementing a method.
static java.util.ArrayList getJavaExprCallingMethod(JxMethod jmethod)
          Obtains all expressions the sort of which are the method call in a given method.
static java.util.ArrayList getJavaExpressionAccessingVariable(JxMethod jmethod)
          Obtains all expressions the sort of which are the variable access in a given method.
static JxMethodList getMethodsWithTheSameSignature(JxMethod jmethod, JxClassList jclasses)
          Obtains all methods in a given collection with the same signature as a given method.
static JxMethodList getOverloadedMethods(JxMethod jmethod)
          Obtains all methods overloaded by a given method.
static JxMethodList getOverloadedMethods(JxMethod jmethod, JxClassList ancestors)
          Obtains all methods overloaded by a given method.
static JxMethodList getOverloadingMethods(JxMethod jmethod)
          Obtains all methods overloading a given method.
static JxMethodList getOverloadingMethods(JxMethod jmethod, JxClassList descendants)
          Obtains all methods overloading a given method.
static JxMethodList getOverriddenMethods(JxMethod jmethod)
          Obtains all methods overridden by a given method.
static JxMethodList getOverriddenMethods(JxMethod jmethod, JxClassList ancestors)
          Obtains all methods overridden by a given method.
static JxMethodList getOverridingMethods(JxMethod jmethod)
          Obtains all methods overriding a given method.
static JxMethodList getOverridingMethods(JxMethod jmethod, JxClassList descendants)
          Obtains all methods overriding a given method.
static JxFieldList getReadFieldInAncestorsOfClass(JxMethod jmethod, JxClass jclass)
          Obtains all read fields in a given method that use any field in ancestors of a given class.
static JxFieldList getReadFieldsInClass(JxMethod jmethod, JxClass jclass)
          Obtains all read fields in a given method that use any field in a given class.
static java.util.ArrayList getThisExpressions(JxMethod jmethod)
          Obtains all expressions the sort of which are the this reference in a given method.
static JxFieldList getUsedFieldsInAncestorsOfAccessClass(JxMethod jmethod, JxClass jclass)
          Obtains all fields in a given method that use any field in ancestors of a given class.
static JxFieldList getUsedFieldsInClass(JxMethod jmethod, JxClass jclass)
          Obtains all fields in a given method that use any field in a given class.
static JxFieldList getWrittenFieldsInAncestorsOfClass(JxMethod jmethod, JxClass jclass)
          Obtains all written fields in a given method that use any field in ancestors of a given class.
static JxFieldList getWrittenFieldsInClass(JxMethod jmethod, JxClass jclass)
          Obtains all written fields in a given method that use any field in a given class.
static boolean hides(JxMethod jm1, JxMethod jm2)
          Tests if a given method hides a given method.
 boolean isApplicable(JxMethodCall ja, JxMethod jm)
          Tests if a given method call is applicable to a given method.
static boolean isApplicable(JxMethod jm1, JxMethod jm2)
          Tests if a method is applicable to a method.
static boolean isConvertible(JxMethod jm1, JxMethod jm2)
          Tests if a method is convertible to a method.
static boolean overloads(JxMethod jm1, JxMethod jm2)
          Tests if a given method overloads by a given method.
static boolean overrides(JxMethod jm1, JxMethod jm2)
          Tests if a given method overrides by a given method.
static boolean readOrWriteVariable(JxMethod jmethod, java.lang.String vname)
          Tests if a given method reads or writes a variable with a name.
static boolean readVariable(JxMethod jmethod, java.lang.String vname)
          Tests if a given method reads a variable with a name.
static boolean usesFieldInAncestorsOfClass(JxMethod jmethod, JxClass jclass)
          Tests if a given method uses any field defined in ancestors of a given class.
static boolean usesFieldsInClass(JxMethod jmethod, JxClass jclass)
          Tests if a given method uses any field defined in a given class.
static boolean usesLocalVariable(JxMethod jmethod, java.lang.String vname)
          Tests if a given method uses a local variable with a given name.
static boolean usesPrivateField(JxMethod jmethod, JxField jfield)
          Tests if a given method uses a given private field.
static boolean usesPrivateFieldInClass(JxMethod jmethod, JxClass jclass)
          Tests if a given method uses any private field in a given class.
static boolean usesVariable(JxMethod jmethod, java.lang.String vname)
          Tests if a given method uses a variable with a given name.
static boolean writeVariable(JxMethod jmethod, java.lang.String vname)
          Tests if a given method writes a variable with a name.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QueryMethod

public QueryMethod()
Method Detail

callsMethodsInClass

public static boolean callsMethodsInClass(JxMethod jmethod,
                                          JxClass jclass)
                                   throws JxUnknownResultException
Tests if a given method calls any method defined in a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method calls any method, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

callsMethodInAncestorsOfClass

public static boolean callsMethodInAncestorsOfClass(JxMethod jmethod,
                                                    JxClass jclass)
                                             throws JxUnknownResultException
Tests if a given method calls any method defined in ancestors of a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method calls any method, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

callsMethodInClassExceptSelf

public static boolean callsMethodInClassExceptSelf(JxMethod jmethod,
                                                   JxClass jclass)
                                            throws JxUnknownResultException
Tests if a given method calls any method defined in a given class except the method itself.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method calls any method, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

callsMethodInAncestorsOfClassExceptSelf

public static boolean callsMethodInAncestorsOfClassExceptSelf(JxMethod jmethod,
                                                              JxClass jclass)
                                                       throws JxUnknownResultException
Tests if a given method calls any method defined in ancestors of a given class except the method itself.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method calls any method, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

getCalledMethodsInClass

public static JxMethodList getCalledMethodsInClass(JxMethod jmethod,
                                                   JxClass jclass)
                                            throws JxUnknownResultException
Obtains all methods in a given class that are called by any method in a given method.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the called methods.
Throws:
JxUnknownResultException - if the result is unknown.

getCalledMethodsInAncestorsOfClass

public static JxMethodList getCalledMethodsInAncestorsOfClass(JxMethod jmethod,
                                                              JxClass jclass)
                                                       throws JxUnknownResultException
Obtains all methods in ancestors of a given class that are called by any method in a given method.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the called methods.
Throws:
JxUnknownResultException - if the result is unknown.

usesFieldsInClass

public static boolean usesFieldsInClass(JxMethod jmethod,
                                        JxClass jclass)
                                 throws JxUnknownResultException
Tests if a given method uses any field defined in a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method uses any field, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

usesFieldInAncestorsOfClass

public static boolean usesFieldInAncestorsOfClass(JxMethod jmethod,
                                                  JxClass jclass)
                                           throws JxUnknownResultException
Tests if a given method uses any field defined in ancestors of a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method uses any field, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

getUsedFieldsInClass

public static JxFieldList getUsedFieldsInClass(JxMethod jmethod,
                                               JxClass jclass)
                                        throws JxUnknownResultException
Obtains all fields in a given method that use any field in a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the used fields.
Throws:
JxUnknownResultException - if the result is unknown.

getUsedFieldsInAncestorsOfAccessClass

public static JxFieldList getUsedFieldsInAncestorsOfAccessClass(JxMethod jmethod,
                                                                JxClass jclass)
                                                         throws JxUnknownResultException
Obtains all fields in a given method that use any field in ancestors of a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the used fields.
Throws:
JxUnknownResultException - if the result is unknown.

getReadFieldInAncestorsOfClass

public static JxFieldList getReadFieldInAncestorsOfClass(JxMethod jmethod,
                                                         JxClass jclass)
                                                  throws JxUnknownResultException
Obtains all read fields in a given method that use any field in ancestors of a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the read fields.
Throws:
JxUnknownResultException - if the result is unknown.

getReadFieldsInClass

public static JxFieldList getReadFieldsInClass(JxMethod jmethod,
                                               JxClass jclass)
                                        throws JxUnknownResultException
Obtains all read fields in a given method that use any field in a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the read fields.
Throws:
JxUnknownResultException - if the result is unknown.

getWrittenFieldsInAncestorsOfClass

public static JxFieldList getWrittenFieldsInAncestorsOfClass(JxMethod jmethod,
                                                             JxClass jclass)
                                                      throws JxUnknownResultException
Obtains all written fields in a given method that use any field in ancestors of a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the written fields.
Throws:
JxUnknownResultException - if the result is unknown.

getWrittenFieldsInClass

public static JxFieldList getWrittenFieldsInClass(JxMethod jmethod,
                                                  JxClass jclass)
                                           throws JxUnknownResultException
Obtains all written fields in a given method that use any field in a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
The collection of the written fields.
Throws:
JxUnknownResultException - if the result is unknown.

callsPrivateMethodInClass

public static boolean callsPrivateMethodInClass(JxMethod jmethod,
                                                JxClass jclass)
                                         throws JxUnknownResultException
Tests if a given method calls any private method in a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method calls any private method, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

callsPrivateMethodInClassExceptSelf

public static boolean callsPrivateMethodInClassExceptSelf(JxMethod jmethod,
                                                          JxClass jclass)
                                                   throws JxUnknownResultException
Tests if a given method calls any private method in a given class except the method itself.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method calls any private method, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

usesPrivateFieldInClass

public static boolean usesPrivateFieldInClass(JxMethod jmethod,
                                              JxClass jclass)
                                       throws JxUnknownResultException
Tests if a given method uses any private field in a given class.

Parameters:
jmethod - A method wrapper.
jclass - A class wrapper.
Returns:
true if the method uses any private field, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

usesPrivateField

public static boolean usesPrivateField(JxMethod jmethod,
                                       JxField jfield)
                                throws JxUnknownResultException
Tests if a given method uses a given private field.

Parameters:
jmethod - A method wrapper.
jfield - A field wrapper.
Returns:
true if the method uses the private field, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

usesVariable

public static boolean usesVariable(JxMethod jmethod,
                                   java.lang.String vname)
                            throws JxUnknownResultException
Tests if a given method uses a variable with a given name.

Parameters:
jmethod - A method wrapper.
vname - A variable name.
Returns:
true if the method uses the variable, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

usesLocalVariable

public static boolean usesLocalVariable(JxMethod jmethod,
                                        java.lang.String vname)
                                 throws JxUnknownResultException
Tests if a given method uses a local variable with a given name.

Parameters:
jmethod - A method wrapper.
vname - A local variable name.
Returns:
true if the method uses the local variable, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

readVariable

public static boolean readVariable(JxMethod jmethod,
                                   java.lang.String vname)
                            throws JxUnknownResultException
Tests if a given method reads a variable with a name.

Parameters:
jmethod - A method wrapper.
vname - A variable name.
Returns:
true if the method reads the variable, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

writeVariable

public static boolean writeVariable(JxMethod jmethod,
                                    java.lang.String vname)
                             throws JxUnknownResultException
Tests if a given method writes a variable with a name.

Parameters:
jmethod - A method wrapper.
vname - A variable name.
Returns:
true if the method writes the variable, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

readOrWriteVariable

public static boolean readOrWriteVariable(JxMethod jmethod,
                                          java.lang.String vname)
                                   throws JxUnknownResultException
Tests if a given method reads or writes a variable with a name.

Parameters:
jmethod - A method wrapper.
vname - A variable name.
Returns:
true if the method uses the variable, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

getMethodsWithTheSameSignature

public static JxMethodList getMethodsWithTheSameSignature(JxMethod jmethod,
                                                          JxClassList jclasses)
Obtains all methods in a given collection with the same signature as a given method.

Parameters:
jmethod - A method wrapper.
jclasses - A collection of classes.
Returns:
The collection of methods with the same signature.
Throws:
JxUnknownResultException - if the result is unknown.

getOverriddenMethods

public static JxMethodList getOverriddenMethods(JxMethod jmethod)
                                         throws JxUnknownResultException
Obtains all methods overridden by a given method. (JLS 8.4.6.1) If the given method is static, use getHiddenMethods(JxMethod jmethod). The overridden method "is implemented by" the given method if the given method is non-abstract and the overridden method is abstract.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the overridden methods.
Throws:
JxUnknownResultException - if the result is unknown.

getOverriddenMethods

public static JxMethodList getOverriddenMethods(JxMethod jmethod,
                                                JxClassList ancestors)
                                         throws JxUnknownResultException
Obtains all methods overridden by a given method.

Parameters:
jmethod - A method wrapper.
ancestors - A collection of ancestors to be examined.
Returns:
The collection of the overridden methods.
Throws:
JxUnknownResultException - if the result is unknown.

getOverridingMethods

public static JxMethodList getOverridingMethods(JxMethod jmethod)
                                         throws JxUnknownResultException
Obtains all methods overriding a given method. (JLS 8.4.6.1) If the given method is static, use getHidingMethods(JxMethod jmethod). The overriding method "implements" the given method if the given method is abstract and the overriding method is non-abstract.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the overriding methods.
Throws:
JxUnknownResultException - if the result is unknown.

getOverridingMethods

public static JxMethodList getOverridingMethods(JxMethod jmethod,
                                                JxClassList descendants)
                                         throws JxUnknownResultException
Obtains all methods overriding a given method.

Parameters:
jmethod - A method wrapper.
descendants - A collection of descendants to be examined.
Returns:
The collection of the overriding methods.
Throws:
JxUnknownResultException - if the result is unknown.

overrides

public static boolean overrides(JxMethod jm1,
                                JxMethod jm2)
Tests if a given method overrides by a given method.

Parameters:
jm1 - A wrapper of a overriding method.
jm2 - A wrapper of a overridden method.
Returns:
true if the first method overrides the second method, otherwise false.

getHiddenMethods

public static JxMethodList getHiddenMethods(JxMethod jmethod)
                                     throws JxUnknownResultException
Obtains all methods hidden by a given method. (JLS 8.4.6.2)

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the hidden methods.
Throws:
JxUnknownResultException - if the result is unknown.

getHiddenMethods

public static JxMethodList getHiddenMethods(JxMethod jmethod,
                                            JxClassList ancestors)
                                     throws JxUnknownResultException
Obtains all methods hidden by a given method.

Parameters:
jmethod - A method wrapper.
ancestors - A collection of ancestors to be examined.
Returns:
The collection of the hidden methods.
Throws:
JxUnknownResultException - if the result is unknown.

getHidingMethods

public static JxMethodList getHidingMethods(JxMethod jmethod)
                                     throws JxUnknownResultException
Obtains all methods hiding a given method. (JLS 8.4.6.2)

Parameters:
jmethod - A method wrapper.
Returns:
The collection of hiding methods.
Throws:
JxUnknownResultException - if the result is unknown.

getHidingMethods

public static JxMethodList getHidingMethods(JxMethod jmethod,
                                            JxClassList descendants)
                                     throws JxUnknownResultException
Obtains all methods hiding a given method.

Parameters:
jmethod - A method wrapper.
descendants - A collection of descendants to be examined.
Returns:
The collection of hiding methods.
Throws:
JxUnknownResultException - if the result is unknown.

hides

public static boolean hides(JxMethod jm1,
                            JxMethod jm2)
Tests if a given method hides a given method.

Parameters:
jm1 - A wrapper of a hiding method.
jm2 - A wrapper of a hidden method.
Returns:
true if the first method hides by the second method, otherwise false.

getOverloadedMethods

public static JxMethodList getOverloadedMethods(JxMethod jmethod)
                                         throws JxUnknownResultException
Obtains all methods overloaded by a given method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the overloaded methods.
Throws:
JxUnknownResultException - if the result is unknown.

getOverloadedMethods

public static JxMethodList getOverloadedMethods(JxMethod jmethod,
                                                JxClassList ancestors)
                                         throws JxUnknownResultException
Obtains all methods overloaded by a given method.

Parameters:
jmethod - A method wrapper.
ancestors - A collection of ancestors to be examined.
Returns:
The collection of the overloaded methods.
Throws:
JxUnknownResultException - if the result is unknown.

getOverloadingMethods

public static JxMethodList getOverloadingMethods(JxMethod jmethod)
                                          throws JxUnknownResultException
Obtains all methods overloading a given method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the overloading methods.
Throws:
JxUnknownResultException - if the result is unknown.

getOverloadingMethods

public static JxMethodList getOverloadingMethods(JxMethod jmethod,
                                                 JxClassList descendants)
                                          throws JxUnknownResultException
Obtains all methods overloading a given method.

Parameters:
jmethod - A methiod wrapper.
descendants - A collection of descendants to be examined.
Returns:
The collection of the overloading methods.
Throws:
JxUnknownResultException - if the result is unknown.

overloads

public static boolean overloads(JxMethod jm1,
                                JxMethod jm2)
Tests if a given method overloads by a given method.

Parameters:
jm1 - A wrapper of a overloading method.
jm2 - A wrapper of a overloaded method.
Returns:
true if the first method overrides the second method, otherwise false.

getIndirectlyImplementedMethods

public static JxMethodList getIndirectlyImplementedMethods(JxMethod jmethod)
                                                    throws JxUnknownResultException
Obtains all methods indirectly implemented by a given method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the implemented methods.
Throws:
JxUnknownResultException - if the result is unknown.

getIndirectlyImplementingMethods

public static JxMethodList getIndirectlyImplementingMethods(JxMethod jmethod)
                                                     throws JxUnknownResultException
Obtains all methods indirectly implementing a method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the implementing methods.
Throws:
JxUnknownResultException - if the result is unknown.

getApplicableMethodsInAncestors

public static JxMethodList getApplicableMethodsInAncestors(JxMethod jmethod)
                                                    throws JxUnknownResultException
Obtains all methods which are applicable to a given method in ancestors of a class defining the method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the applicable methods.
Throws:
JxUnknownResultException - if the result is unknown.

getApplicableMethodsInDescendants

public static JxMethodList getApplicableMethodsInDescendants(JxMethod jmethod)
                                                      throws JxUnknownResultException
Obtains all methods which are applicable to a given method in descendants of a class defining the method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of the applicable methods.
Throws:
JxUnknownResultException - if the result is unknown.

isApplicable

public boolean isApplicable(JxMethodCall ja,
                            JxMethod jm)
                     throws JxUnknownResultException
Tests if a given method call is applicable to a given method.

Parameters:
ja - A method call wrapper.
jm - A method wrapper.
Returns:
true if the method call is applicable, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

isApplicable

public static boolean isApplicable(JxMethod jm1,
                                   JxMethod jm2)
                            throws JxUnknownResultException
Tests if a method is applicable to a method.

Parameters:
jm1 - A method wrapper.
jm2 - A method wrapper.
Returns:
true if the first method call is applicable to the second method, otherwise false.
Throws:
JxUnknownResultException - if the result is unknown.

isConvertible

public static boolean isConvertible(JxMethod jm1,
                                    JxMethod jm2)
                             throws JxUnknownResultException
Tests if a method is convertible to a method.

Parameters:
jm1 - A method wrapper.
jm2 - A method wrapper.
Returns:
true if the first method call is convertible to the second method, otherwise false.
Throws:
JxUnknownResultException

getThisExpressions

public static java.util.ArrayList getThisExpressions(JxMethod jmethod)
                                              throws JxUnknownResultException
Obtains all expressions the sort of which are the this reference in a given method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of JxExpression objects.
Throws:
JxUnknownResultException - if the result is unknown.

getJavaExprCallingMethod

public static java.util.ArrayList getJavaExprCallingMethod(JxMethod jmethod)
                                                    throws JxUnknownResultException
Obtains all expressions the sort of which are the method call in a given method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of JxExpression objects.
Throws:
JxUnknownResultException - if the result is unknown.

getJavaExpressionAccessingVariable

public static java.util.ArrayList getJavaExpressionAccessingVariable(JxMethod jmethod)
                                                              throws JxUnknownResultException
Obtains all expressions the sort of which are the variable access in a given method.

Parameters:
jmethod - A method wrapper.
Returns:
The collection of JxExpression objects.
Throws:
JxUnknownResultException - if the result is unknown.