cetus.hir
Interface Annotatable

All Known Implementing Classes:
AccessLevel, AnnotationDeclaration, AnnotationStatement, BreakStatement, Case, ClassDeclaration, CompoundStatement, ContinueStatement, Declaration, DeclarationStatement, Default, DoLoop, Enumeration, ExceptionHandler, ExpressionStatement, ForLoop, GotoStatement, IfStatement, Label, LinkageSpecification, Namespace, NamespaceAlias, NullStatement, PreAnnotation, Procedure, ReturnStatement, Statement, SwitchStatement, TemplateDeclaration, UsingDeclaration, UsingDirective, VariableDeclaration, WhileLoop

public interface Annotatable

Annotatable interface defines methods for Cetus IR that contains a list of annotations. Declaration and Statement implement Annotatable now.


Method Summary
 void annotate(Annotation annotation)
          Annotates with the given annotation.
 void annotateAfter(Annotation annotation)
           
 void annotateBefore(Annotation annotation)
           
 java.lang.String annotationToString(int position)
          Returns the string representation of the annotations with the given relative position.
 boolean containsAnnotation(java.lang.Class<? extends Annotation> type, java.lang.String key)
          Checks if this annotatable contains the specified annotation type and key.
<T extends Annotation>
T
getAnnotation(java.lang.Class<T> type, java.lang.String key)
          Returns the annotation with the specified type and key.
 java.util.List<Annotation> getAnnotations()
          Returns the list of annotations.
<T extends Annotation>
java.util.List<T>
getAnnotations(java.lang.Class<T> type)
          Returns the list of annotations with the given type.
 java.util.List<Annotation> getAnnotations(int position)
          Returns the list of annotations with the given relative position.
 void removeAnnotations()
          Remove all annotations.
 void removeAnnotations(java.lang.Class<?> type)
          Remove all annotations of the given type.
 java.lang.String toAnnotatedString()
          Returns the string representation of the object with annotations being printed as well.
 

Method Detail

annotate

void annotate(Annotation annotation)
Annotates with the given annotation.


annotateAfter

void annotateAfter(Annotation annotation)

annotateBefore

void annotateBefore(Annotation annotation)

getAnnotations

java.util.List<Annotation> getAnnotations()
Returns the list of annotations.


getAnnotations

<T extends Annotation> java.util.List<T> getAnnotations(java.lang.Class<T> type)
Returns the list of annotations with the given type.


containsAnnotation

boolean containsAnnotation(java.lang.Class<? extends Annotation> type,
                           java.lang.String key)
Checks if this annotatable contains the specified annotation type and key.


getAnnotation

<T extends Annotation> T getAnnotation(java.lang.Class<T> type,
                                       java.lang.String key)
Returns the annotation with the specified type and key.


getAnnotations

java.util.List<Annotation> getAnnotations(int position)
Returns the list of annotations with the given relative position.


removeAnnotations

void removeAnnotations()
Remove all annotations.


removeAnnotations

void removeAnnotations(java.lang.Class<?> type)
Remove all annotations of the given type.


annotationToString

java.lang.String annotationToString(int position)
Returns the string representation of the annotations with the given relative position.


toAnnotatedString

java.lang.String toAnnotatedString()
Returns the string representation of the object with annotations being printed as well.