public abstract class ExternalAnnotationsManager
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
ExternalAnnotationsManager.AnnotationPlace
Describes where to place the new annotation
|
static class |
ExternalAnnotationsManager.CanceledConfigurationException |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
ANNOTATIONS_XML |
static Topic<ExternalAnnotationsListener> |
TOPIC |
| Constructor and Description |
|---|
ExternalAnnotationsManager() |
| Modifier and Type | Method and Description |
|---|---|
abstract void |
annotateExternally(PsiModifierListOwner listOwner,
java.lang.String annotationFQName,
PsiFile fromFile,
PsiNameValuePair [] value) |
abstract ExternalAnnotationsManager.AnnotationPlace |
chooseAnnotationsPlace(PsiElement element) |
abstract ExternalAnnotationsManager.AnnotationPlace |
chooseAnnotationsPlaceNoUi(PsiElement element) |
abstract boolean |
deannotate(PsiModifierListOwner listOwner,
java.lang.String annotationFQN) |
abstract boolean |
editExternalAnnotation(PsiModifierListOwner listOwner,
java.lang.String annotationFQN,
PsiNameValuePair [] value) |
void |
elementRenamedOrMoved(PsiModifierListOwner element,
java.lang.String oldExternalName) |
abstract java.util.List<PsiAnnotation> |
findDefaultConstructorExternalAnnotations(PsiClass aClass)
Returns external annotations associated with default
constructor of the
aClass, if the constructor exists. |
abstract java.util.List<PsiAnnotation> |
findDefaultConstructorExternalAnnotations(PsiClass aClass,
java.lang.String annotationFQN)
Returns external annotations with fully qualified name of
annotationFQN
associated with default constructor of the aClass, if the constructor exists. |
abstract PsiAnnotation |
findExternalAnnotation(PsiModifierListOwner listOwner,
java.lang.String annotationFQN) |
abstract PsiAnnotation [] |
findExternalAnnotations(PsiModifierListOwner listOwner) |
abstract java.util.List<PsiAnnotation> |
findExternalAnnotations(PsiModifierListOwner listOwner,
java.lang.String annotationFQN)
Returns external annotations with fully qualified name of
annotationFQN
associated with listOwner. |
abstract java.util.List<PsiFile> |
findExternalAnnotationsFiles(PsiModifierListOwner listOwner) |
static ExternalAnnotationsManager |
getInstance(Project project) |
abstract boolean |
hasAnnotationRootsForFile(VirtualFile file) |
abstract boolean |
isExternalAnnotation(PsiAnnotation annotation) |
abstract boolean |
isExternalAnnotationWritable(PsiModifierListOwner listOwner,
java.lang.String annotationFQN) |
public static final java.lang.String ANNOTATIONS_XML
public static final Topic<ExternalAnnotationsListener> TOPIC
public static ExternalAnnotationsManager getInstance(Project project)
public abstract boolean hasAnnotationRootsForFile(VirtualFile file)
public abstract boolean isExternalAnnotation(PsiAnnotation annotation)
public abstract PsiAnnotation findExternalAnnotation(PsiModifierListOwner listOwner, java.lang.String annotationFQN)
public abstract java.util.List<PsiAnnotation> findExternalAnnotations(PsiModifierListOwner listOwner, java.lang.String annotationFQN)
annotationFQN
associated with listOwner.
Multiple results may be returned for repeatable annotations and annotations
from several external annotations roots.listOwner - API element to return external annotations ofannotationFQN - fully qualified name of the annotation to search forlistOwnerpublic abstract boolean isExternalAnnotationWritable(PsiModifierListOwner listOwner, java.lang.String annotationFQN)
public abstract PsiAnnotation [] findExternalAnnotations(PsiModifierListOwner listOwner)
public abstract java.util.List<PsiAnnotation> findDefaultConstructorExternalAnnotations(PsiClass aClass)
aClass, if the constructor exists.
Default constructors should be handled specially
because they don't have PsiModifierListOwner,
nor they are returned in PsiClass.getConstructors().
Yet default constructors may be externally annotated
in corresponding annotations.xml:
<item name='com.example.Foo Foo()'>
<annotation name='org.some.Annotation'/>
</item>aClass - class of which default constructor's external annotations are to be foundaClass or null
if the class doesn't have a default constructorpublic abstract java.util.List<PsiAnnotation> findDefaultConstructorExternalAnnotations(PsiClass aClass, java.lang.String annotationFQN)
annotationFQN
associated with default constructor of the aClass, if the constructor exists.
Multiple annotations may be returned since there may be repeatable annotations
or annotations from several external annotations roots.aClass - class of which default constructor's external annotations are to be foundannotationFQN - fully qualified name of annotation class to search foraClass, or null if the
class doesn't have a default constructor.findDefaultConstructorExternalAnnotations(PsiClass)public abstract void annotateExternally(PsiModifierListOwner listOwner, java.lang.String annotationFQName, PsiFile fromFile, PsiNameValuePair [] value) throws ExternalAnnotationsManager.CanceledConfigurationException
public abstract boolean deannotate(PsiModifierListOwner listOwner, java.lang.String annotationFQN)
public void elementRenamedOrMoved(PsiModifierListOwner element, java.lang.String oldExternalName)
public abstract boolean editExternalAnnotation(PsiModifierListOwner listOwner, java.lang.String annotationFQN, PsiNameValuePair [] value)
public abstract ExternalAnnotationsManager.AnnotationPlace chooseAnnotationsPlaceNoUi(PsiElement element)
element - element to add new annotation forExternalAnnotationsManager.AnnotationPlace.NEED_ASK_USER if the user confirmation is necessary.public abstract ExternalAnnotationsManager.AnnotationPlace chooseAnnotationsPlace(PsiElement element)
element - element to add new annotation forpublic abstract java.util.List<PsiFile> findExternalAnnotationsFiles(PsiModifierListOwner listOwner)