| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
This class contains a set of useful static methods for finding members in classes, checking the relationship between classes(interfaces), and getting a function call expression from a reference to a function.
| Method Summary | |
static Enumeration | allMembers(SciClass sciClass, boolean filterOverriden)Returns an enumeration of all the members this class has, including inherited members. |
static SciAttribute | findAttributeByName(SciClass sciClass, String name)Finds an attribute by its name and containing class. |
static SciClass | findClassByName(SciContainer container, String name) |
static SciClass | findClassByName(SciContainer container, SciClass aClass) |
static SciMember | findMemberBySignature(SciClass sciClass, String signature)Finds SciMember by its containing class and the signature. |
static SciMember | findMemberBySignature(SciClass sciClass, SciMember patternMember)Finds SciMember by its containing class and another member having the same
signature. |
static SciMember | findMemberBySignature(SciClass sciClass, String signature, boolean searchInBaseClasses)Finds SciMember by the signature in the specified class(interface), or in its parents. |
static SciMember | findMemberBySignature(SciClass sciClass, SciMember patternMember, boolean searchInBaseClasses)Finds SciMember by another member having the same
signature, in the specified class(interface), or in its parents. |
static SciFunctionCallExpression | getFunctionCallFromReference(SciReferenceExpression referenceExpression)Returns a SciFunctionCallExpression for the specified reference to a function. |
static boolean | isInheritor(SciClass aClass, SciClass base, boolean checkDeepInheritance)Checks whether the specified class(interface) is a descendant of another class or interface. |
| Method Detail |
public static Enumeration allMembers(SciClass sciClass, boolean filterOverriden)
SciClass in which members are being searchedtrue then this method will
not return overriden members in superclasses.Enumerationpublic static SciAttribute findAttributeByName(SciClass sciClass, String name)
SciClass in which an attribute is being searchedSciAttribute containing in the specified class and having the specified name,
null otherwisepublic static SciClass findClassByName(SciContainer container, String name)
public static SciClass findClassByName(SciContainer container, SciClass aClass)
public static SciMember findMemberBySignature(SciClass sciClass, String signature)
SciMember by its containing class and the signature.SciClass in which a member is being searchedSciMember having the specified signature and contained in the specified class;
null otherwise.public static SciMember findMemberBySignature(SciClass sciClass, SciMember patternMember)
SciMember by its containing class and another member having the same
signature. This method works faster than
findMemberBySignature(SciClass,String),
because it calculates and compares signatures only if the names of the members
being compared are matching.SciClass in which a member is being searchedSciMember having the same signature as the target memberSciMember containing in the specified class and having the same signature
as the specified member, null otherwise.public static SciMember findMemberBySignature(SciClass sciClass, String signature, boolean searchInBaseClasses)
SciMember by the signature in the specified class(interface), or in its parents.SciClass in which a member is being searchedtrue then a member will be searched
in the classes and interfaces (in classes first) which sciClass extends and/or implements.
If false then it will be searched in the sciClass only.SciMember having the specified signature and contained in the specified class(interface),
or in its parents,
null otherwise.public static SciMember findMemberBySignature(SciClass sciClass, SciMember patternMember, boolean searchInBaseClasses)
SciMember by another member having the same
signature, in the specified class(interface), or in its parents. This method works faster
than findMemberBySignature(SciClass, String, boolean),
because it calculates and compares signatures only if the names of the members
being compared are matching.SciClass in which a member is being searchedSciMember having the same signature as the target membertrue then a member will be searched
in the classes and interfaces (in classes first) which sciClass extends and/or implements.
If false then it will be searched in the sciClass only.SciMember having the same signature
as the specified member, and contained in the specified class(interface),
or in its parents;
null otherwise.public static SciFunctionCallExpression getFunctionCallFromReference(SciReferenceExpression referenceExpression)
SciFunctionCallExpression for the specified reference to a function. For references
not to the functions this method returns null. It is very convenient method, because
once you've got a reference (for example, in a
SciReferenceVisitor),
you can
check if it appears in the function call expression, and get this expression if it does.
Let us suppose we have a line in the source code:
someObject.someMethod();
For SciReference representing a reference to someMethod this method will return
SciFuncionCallExpression for the original source code line.SciReference representing a reference to someObject this method will return
null.
Note that since in Java (unlike C++) any usage of a method's name may
appear only in the function call expressions,
this method won't return null for references to methods.
SciReferenceExpressionSciFunctionCallExpression, or nullpublic static boolean isInheritor(SciClass aClass, SciClass base, boolean checkDeepInheritance)
SciClassSciClasstrue then this method
will analyze not only direct inheritances, but will scan the whole hierarchy of
parents of aClass.true if aClass is a descendant of base, false
otherwise
| |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||