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

2 comments

PsiElement[] getOnDemandImports(boolean includeImplicit, boolean
checkIncludes);
PsiClass[] getSingleClassImports(boolean checkIncludes);
String[] getImplicitlyImportedPackages();
PsiJavaCodeReferenceElement[] getImplicitlyImportedPackageReferences();
PsiJavaCodeReferenceElement findImportReferenceTo(PsiClass aClass);

and what's the differences between ::

>

PsiElement PsiReference.getElement()

>

and

>

PsiElement PsiReference.resolve()


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...

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

>


0

Please sign in to leave a comment.