PsiFile in v3.0.5
Does anybody know the formal parameters meaning in the methods ::
PsiFile.getSingleClassImportReferences( boolean )
psiFile.getOnDemandImportReferences( boolean, boolean )
and what's the differences between ::
PsiElement PsiReference.getElement()
and
PsiElement PsiReference.resolve()
Thanks,
_marc
Please sign in to leave a comment.
PsiElement[] getOnDemandImports(boolean includeImplicit, boolean
checkIncludes);
PsiClass[] getSingleClassImports(boolean checkIncludes);
String[] getImplicitlyImportedPackages();
PsiJavaCodeReferenceElement[] getImplicitlyImportedPackageReferences();
PsiJavaCodeReferenceElement findImportReferenceTo(PsiClass aClass);
>
>
>
PsiReference.resolve() "resolves" the reference and returns element to which
it refers. It may return null when reference cannot be resolved (e.g.
non-compilable code).
PsiReference.getElement() has nothing to do with that. To understand what it
means we should look into another method: PsiElement.getReferences(). That
is any element may contain some amount of reference associated with it.
PsiReference.getElement() returns the original element to which the
reference is associated (is never null).
--
Valentin Kipiatkov
JetBrains, Inc
http://www.intellij.com
"Develop with pleasure!"
"Marc Polizzi" <no_mail@jetbrains.com> wrote in message
news:13209607.1067886598005.JavaMail.itn@is.intellij.net...
>
>
>
>
>
>
>
>
Thanks for your help,
_marc