org.eclipse.jpt.core.utility.jdt
Interface ModifiedDeclaration


public interface ModifiedDeclaration

Define a wrapper that provides a common protocol for all the various AST declarations that have modifiers (i.e. there are a number of AST node classes that implement the method #modifiers(), but they do not implement a common interface): BodyDeclaration SingleVariableDeclaration VariableDeclarationExpression VariableDeclarationStatement Provisional API: This interface is part of an interim API that is still under development and expected to change significantly before reaching stability. It is available at this early stage to solicit feedback from pioneering adopters on the understanding that any code that uses this API will almost certainly be broken (repeatedly) as the API evolves. This interface is not intended to be implemented by clients.


Method Summary
 void addImport(java.lang.String importName)
          Add the specified import to the declaration's compilation unit.
 void addImport(java.lang.String importName, boolean static_)
          Add the specified import to the declaration's compilation unit.
 void addStaticImport(java.lang.String importName)
          Add the specified static import to the declaration's compilation unit.
 boolean annotationIsNamed(org.eclipse.jdt.core.dom.Annotation annotation, java.lang.String name)
          Return whether the specified annotation has the specified name.
 org.eclipse.jdt.core.dom.Annotation getAnnotationNamed(java.lang.String annotationName)
          Return the *first* annotation with the specified name.
 org.eclipse.jdt.core.dom.AST getAst()
          Return the "declaration" AST.
 org.eclipse.jdt.core.dom.ASTNode getDeclaration()
          Return the "declaration" AST node.
 void removeAnnotationNamed(java.lang.String annotationName)
          Remove the *first* annotation with the specified name from the declaration.
 void replaceAnnotationNamed(java.lang.String oldAnnotationName, org.eclipse.jdt.core.dom.Annotation newAnnotation)
          Replace the specified old annotation with the specified new annotation.
 

Method Detail

getDeclaration

org.eclipse.jdt.core.dom.ASTNode getDeclaration()
Return the "declaration" AST node.


getAst

org.eclipse.jdt.core.dom.AST getAst()
Return the "declaration" AST.


getAnnotationNamed

org.eclipse.jdt.core.dom.Annotation getAnnotationNamed(java.lang.String annotationName)
Return the *first* annotation with the specified name. Return null if the declaration has no such annotation.


removeAnnotationNamed

void removeAnnotationNamed(java.lang.String annotationName)
Remove the *first* annotation with the specified name from the declaration.


replaceAnnotationNamed

void replaceAnnotationNamed(java.lang.String oldAnnotationName,
                            org.eclipse.jdt.core.dom.Annotation newAnnotation)
Replace the specified old annotation with the specified new annotation. If there is no annotation with the specified name, simply add the new annotation to the declaration's modifiers.


addImport

void addImport(java.lang.String importName)
Add the specified import to the declaration's compilation unit.


addStaticImport

void addStaticImport(java.lang.String importName)
Add the specified static import to the declaration's compilation unit.


addImport

void addImport(java.lang.String importName,
               boolean static_)
Add the specified import to the declaration's compilation unit.


annotationIsNamed

boolean annotationIsNamed(org.eclipse.jdt.core.dom.Annotation annotation,
                          java.lang.String name)
Return whether the specified annotation has the specified name.