1 package spoon.reflect.declaration; 2 3 import java.lang.annotation.Annotation ; 4 import java.util.List ; 5 import java.util.Set ; 6 7 import spoon.processing.FactoryAccessor; 8 import spoon.reflect.reference.CtTypeReference; 9 import spoon.reflect.visitor.CtVisitor; 10 import spoon.reflect.visitor.Filter; 11 import spoon.reflect.visitor.Root; 12 13 17 @Root 18 public interface CtElement extends FactoryAccessor, Comparable <CtElement> { 19 25 void accept(CtVisitor visitor); 26 27 37 <A extends Annotation > A getAnnotation(Class <A> annotationType); 38 39 47 <A extends Annotation > CtAnnotation<A> getAnnotation( 48 CtTypeReference<A> annotationType); 49 50 53 Set <CtAnnotation<? extends Annotation >> getAnnotations(); 54 55 59 String getDocComment(); 60 61 64 CtElement getParent(); 65 66 69 <P extends CtElement> P getParent(Class <P> parentType); 70 71 74 boolean hasParent(CtElement candidate); 75 76 81 SourcePosition getPosition(); 82 83 86 void replace(CtElement element); 87 88 91 void replace(Filter<? extends CtElement> replacementPoints, 92 CtElement element); 93 94 97 void setAnnotations(Set <CtAnnotation<? extends Annotation >> annotation); 98 99 103 void setDocComment(String docComment); 104 105 111 void setParent(CtElement element); 112 113 119 void setPosition(SourcePosition position); 120 121 132 <E extends CtElement> List <E> getAnnotatedChildren( 133 Class <? extends Annotation > annotationType); 134 135 } | Popular Tags |