|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.jtool.jxplatform.query.QueryMethod
A utility class which provides quaries about methods.
Do not pass null to any parameter in methods in this class.
| 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 |
public QueryMethod()
| Method Detail |
public static boolean callsMethodsInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method calls any method, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean callsMethodInAncestorsOfClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method calls any method, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean callsMethodInClassExceptSelf(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method calls any method, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean callsMethodInAncestorsOfClassExceptSelf(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method calls any method, otherwise false.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getCalledMethodsInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getCalledMethodsInAncestorsOfClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static boolean usesFieldsInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method uses any field, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean usesFieldInAncestorsOfClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method uses any field, otherwise false.
JxUnknownResultException - if the result is unknown.
public static JxFieldList getUsedFieldsInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static JxFieldList getUsedFieldsInAncestorsOfAccessClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static JxFieldList getReadFieldInAncestorsOfClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static JxFieldList getReadFieldsInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static JxFieldList getWrittenFieldsInAncestorsOfClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static JxFieldList getWrittenFieldsInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
JxUnknownResultException - if the result is unknown.
public static boolean callsPrivateMethodInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method calls any private method, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean callsPrivateMethodInClassExceptSelf(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method calls any private method, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean usesPrivateFieldInClass(JxMethod jmethod,
JxClass jclass)
throws JxUnknownResultException
jmethod - A method wrapper.jclass - A class wrapper.
true if the method uses any private field, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean usesPrivateField(JxMethod jmethod,
JxField jfield)
throws JxUnknownResultException
jmethod - A method wrapper.jfield - A field wrapper.
true if the method uses the private field, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean usesVariable(JxMethod jmethod,
java.lang.String vname)
throws JxUnknownResultException
jmethod - A method wrapper.vname - A variable name.
true if the method uses the variable, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean usesLocalVariable(JxMethod jmethod,
java.lang.String vname)
throws JxUnknownResultException
jmethod - A method wrapper.vname - A local variable name.
true if the method uses the local variable, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean readVariable(JxMethod jmethod,
java.lang.String vname)
throws JxUnknownResultException
jmethod - A method wrapper.vname - A variable name.
true if the method reads the variable, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean writeVariable(JxMethod jmethod,
java.lang.String vname)
throws JxUnknownResultException
jmethod - A method wrapper.vname - A variable name.
true if the method writes the variable, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean readOrWriteVariable(JxMethod jmethod,
java.lang.String vname)
throws JxUnknownResultException
jmethod - A method wrapper.vname - A variable name.
true if the method uses the variable, otherwise false.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getMethodsWithTheSameSignature(JxMethod jmethod,
JxClassList jclasses)
jmethod - A method wrapper.jclasses - A collection of classes.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getOverriddenMethods(JxMethod jmethod)
throws JxUnknownResultException
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.
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getOverriddenMethods(JxMethod jmethod,
JxClassList ancestors)
throws JxUnknownResultException
jmethod - A method wrapper.ancestors - A collection of ancestors to be examined.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getOverridingMethods(JxMethod jmethod)
throws JxUnknownResultException
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.
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getOverridingMethods(JxMethod jmethod,
JxClassList descendants)
throws JxUnknownResultException
jmethod - A method wrapper.descendants - A collection of descendants to be examined.
JxUnknownResultException - if the result is unknown.
public static boolean overrides(JxMethod jm1,
JxMethod jm2)
jm1 - A wrapper of a overriding method.jm2 - A wrapper of a overridden method.
true if the first method overrides the second method, otherwise false.
public static JxMethodList getHiddenMethods(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getHiddenMethods(JxMethod jmethod,
JxClassList ancestors)
throws JxUnknownResultException
jmethod - A method wrapper.ancestors - A collection of ancestors to be examined.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getHidingMethods(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getHidingMethods(JxMethod jmethod,
JxClassList descendants)
throws JxUnknownResultException
jmethod - A method wrapper.descendants - A collection of descendants to be examined.
JxUnknownResultException - if the result is unknown.
public static boolean hides(JxMethod jm1,
JxMethod jm2)
jm1 - A wrapper of a hiding method.jm2 - A wrapper of a hidden method.
true if the first method hides by the second method, otherwise false.
public static JxMethodList getOverloadedMethods(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getOverloadedMethods(JxMethod jmethod,
JxClassList ancestors)
throws JxUnknownResultException
jmethod - A method wrapper.ancestors - A collection of ancestors to be examined.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getOverloadingMethods(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getOverloadingMethods(JxMethod jmethod,
JxClassList descendants)
throws JxUnknownResultException
jmethod - A methiod wrapper.descendants - A collection of descendants to be examined.
JxUnknownResultException - if the result is unknown.
public static boolean overloads(JxMethod jm1,
JxMethod jm2)
jm1 - A wrapper of a overloading method.jm2 - A wrapper of a overloaded method.
true if the first method overrides the second method, otherwise false.
public static JxMethodList getIndirectlyImplementedMethods(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getIndirectlyImplementingMethods(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getApplicableMethodsInAncestors(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public static JxMethodList getApplicableMethodsInDescendants(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxUnknownResultException - if the result is unknown.
public boolean isApplicable(JxMethodCall ja,
JxMethod jm)
throws JxUnknownResultException
ja - A method call wrapper.jm - A method wrapper.
true if the method call is applicable, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean isApplicable(JxMethod jm1,
JxMethod jm2)
throws JxUnknownResultException
jm1 - A method wrapper.jm2 - A method wrapper.
true if the first method call is applicable to the second method, otherwise false.
JxUnknownResultException - if the result is unknown.
public static boolean isConvertible(JxMethod jm1,
JxMethod jm2)
throws JxUnknownResultException
jm1 - A method wrapper.jm2 - A method wrapper.
true if the first method call is convertible to the second method, otherwise false.
JxUnknownResultException
public static java.util.ArrayList getThisExpressions(JxMethod jmethod)
throws JxUnknownResultException
this reference in a given method.
jmethod - A method wrapper.
JxExpression objects.
JxUnknownResultException - if the result is unknown.
public static java.util.ArrayList getJavaExprCallingMethod(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxExpression objects.
JxUnknownResultException - if the result is unknown.
public static java.util.ArrayList getJavaExpressionAccessingVariable(JxMethod jmethod)
throws JxUnknownResultException
jmethod - A method wrapper.
JxExpression objects.
JxUnknownResultException - if the result is unknown.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||