i'm building a plugin which will reflect the relations between classes/methods/fields graphically
now let say i use ReferencesSearch on a class i get a collection of PsiReferences
for each reference i can get its context to know what type of reference that is for example instance creation (PsiNewExpression or something like that) inheritance (PsiReferenceList) etc...
if i want different behavior for each relation i need to know what i'm dealing with
i'm building a plugin which will reflect the relations between classes/methods/fields graphically
now let say i use ReferencesSearch on a class i get a collection of PsiReferences for each reference i can get its context to know what type of reference that is for example instance creation (PsiNewExpression or something like that) inheritance (PsiReferenceList) etc... if i want different behavior for each relation i need to know what i'm dealing with
Yes, using instanceof is the correct way to do that.
-- Dmitry Jemerov Development Lead JetBrains, Inc. http://www.jetbrains.com/ "Develop with Pleasure!"
Hello Aviram,
Sorry, what exactly do you mean by "categorizing the results"?
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
i'm building a plugin which will reflect the relations between classes/methods/fields graphically
now let say i use ReferencesSearch on a class
i get a collection of PsiReferences
for each reference i can get its context to know what type of reference that is
for example
instance creation (PsiNewExpression or something like that)
inheritance (PsiReferenceList)
etc...
if i want different behavior for each relation i need to know what i'm dealing with
Hello Aviram,
Yes, using instanceof is the correct way to do that.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"