org.aspectj.org.eclipse.jdt.core.dom
Class AjAST

java.lang.Object
  extended by org.aspectj.org.eclipse.jdt.core.dom.AST
      extended by org.aspectj.org.eclipse.jdt.core.dom.AjAST

public class AjAST
extends AST


Field Summary
 
Fields inherited from class org.aspectj.org.eclipse.jdt.core.dom.AST
JLS2, JLS3, JLS4
 
Method Summary
static CompilationUnit convertCompilationUnit(int level, CompilationUnitDeclaration compilationUnitDeclaration, char[] source, java.util.Map options, boolean isResolved, CompilationUnit workingCopy, IProgressMonitor monitor)
          Internal method.
 AfterAdviceDeclaration newAfterAdviceDeclaration()
          Creates an unparented after advice declaration node owned by this AST.
 AfterReturningAdviceDeclaration newAfterReturningAdviceDeclaration()
          Creates an unparented after returning advice declaration node owned by this AST.
 AfterThrowingAdviceDeclaration newAfterThrowingAdviceDeclaration()
          Creates an unparented after throwing advice declaration node owned by this AST.
static AjAST newAjAST(int level)
          Creates a new AspectJ abstract syntax tree (AST) following the specified set of API rules.
 AjTypeDeclaration newAjTypeDeclaration()
          Creates an unparented ajtype declaration node owned by this AST.
 AndPointcut newAndPointcut()
          Creates an unparented AndPointcut node owned by this AST.
 AroundAdviceDeclaration newAroundAdviceDeclaration()
          Creates an unparented around advice declaration node owned by this AST.
 AspectDeclaration newAspectDeclaration()
          Creates an unparented aspect declaration node owned by this AST.
 BeforeAdviceDeclaration newBeforeAdviceDeclaration()
          Creates an unparented before advice declaration node owned by this AST.
 CflowPointcut newCflowPointcut()
          Creates an unparented CflowPointcut node owned by this AST.
 DeclareAtConstructorDeclaration newDeclareAtConstructorDeclaration()
          Creates an unparented declare at constructor declaration node owned by this AST.
 DeclareAtFieldDeclaration newDeclareAtFieldDeclaration()
          Creates an unparented declare at field declaration node owned by this AST.
 DeclareAtMethodDeclaration newDeclareAtMethodDeclaration()
          Creates an unparented declare at method declaration node owned by this AST.
 DeclareAtTypeDeclaration newDeclareAtTypeDeclaration()
          Creates an unparented declare at type declaration node owned by this AST.
 DeclareErrorDeclaration newDeclareErrorDeclaration()
          Creates an unparented declare error declaration node owned by this AST.
 DeclareParentsDeclaration newDeclareParentsDeclaration()
          Creates an unparented declare parents declaration node owned by this AST.
 DeclarePrecedenceDeclaration newDeclarePrecedenceDeclaration()
          Creates an unparented declare precedence declaration node owned by this AST.
 DeclareSoftDeclaration newDeclareSoftDeclaration()
          Creates an unparented declare soft declaration node owned by this AST.
 DeclareWarningDeclaration newDeclareWarningDeclaration()
          Creates an unparented declare warning declaration node owned by this AST.
 DefaultPointcut newDefaultPointcut()
          Creates an unparented default pointcut node owned by this AST.
 DefaultTypePattern newDefaultTypePattern()
          Creates an unparented default type pattern node owned by this AST.
 InterTypeFieldDeclaration newInterTypeFieldDeclaration()
          Creates a new unparented intertype field declaration node owned by this AST.
 InterTypeMethodDeclaration newInterTypeMethodDeclaration()
          Creates an unparented intertype method declaration node owned by this AST.
 NotPointcut newNotPointcut()
          Creates an unparented NotPointcut node owned by this AST.
 OrPointcut newOrPointcut()
          Creates an unparented OrPointcut node owned by this AST.
 PerCflow newPerCflow()
          Creates an unparented PerCflow node owned by this AST.
 PerObject newPerObject()
          Creates an unparented perobject node owned by this AST.
 PerTypeWithin newPerTypeWithin()
          Creates an unparented pertypewithin node owned by this AST.
 PointcutDeclaration newPointcutDeclaration()
          Creates an unparented pointcut declaration node owned by this AST.
 ReferencePointcut newReferencePointcut()
          Creates an unparented reference pointcut node owned by this AST.
 SignaturePattern newSignaturePattern()
          Creates an unparented default signature pattern node owned by this AST.
 
Methods inherited from class org.aspectj.org.eclipse.jdt.core.dom.AST
apiLevel, convertCompilationUnit, convertCompilationUnit, createInstance, createInstance, hasBindingsRecovery, hasResolvedBindings, hasStatementsRecovery, modificationCount, newAnnotationTypeDeclaration, newAnnotationTypeMemberDeclaration, newAnonymousClassDeclaration, newArrayAccess, newArrayCreation, newArrayInitializer, newArrayType, newArrayType, newAssertStatement, newAssignment, newAST, newBlock, newBlockComment, newBooleanLiteral, newBreakStatement, newCastExpression, newCatchClause, newCharacterLiteral, newClassInstanceCreation, newCompilationUnit, newConditionalExpression, newConstructorInvocation, newContinueStatement, newDoStatement, newEmptyStatement, newEnhancedForStatement, newEnumConstantDeclaration, newEnumDeclaration, newExpressionStatement, newFieldAccess, newFieldDeclaration, newForStatement, newIfStatement, newImportDeclaration, newInfixExpression, newInitializer, newInstanceofExpression, newJavadoc, newLabeledStatement, newLineComment, newMarkerAnnotation, newMemberRef, newMemberValuePair, newMethodDeclaration, newMethodInvocation, newMethodRef, newMethodRefParameter, newModifier, newModifiers, newName, newName, newNormalAnnotation, newNullLiteral, newNumberLiteral, newNumberLiteral, newPackageDeclaration, newParameterizedType, newParenthesizedExpression, newPostfixExpression, newPrefixExpression, newPrimitiveType, newQualifiedName, newQualifiedType, newReturnStatement, newSimpleName, newSimpleType, newSingleMemberAnnotation, newSingleVariableDeclaration, newStringLiteral, newSuperConstructorInvocation, newSuperFieldAccess, newSuperMethodInvocation, newSwitchCase, newSwitchStatement, newSynchronizedStatement, newTagElement, newTextElement, newThisExpression, newThrowStatement, newTryStatement, newTypeDeclaration, newTypeDeclarationStatement, newTypeDeclarationStatement, newTypeLiteral, newTypeParameter, newUnionType, newVariableDeclarationExpression, newVariableDeclarationFragment, newVariableDeclarationStatement, newWhileStatement, newWildcardType, parseCompilationUnit, parseCompilationUnit, parseCompilationUnit, parseCompilationUnit, resolveWellKnownType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

newAjAST

public static AjAST newAjAST(int level)
Creates a new AspectJ abstract syntax tree (AST) following the specified set of API rules.

Clients should use this method specifing AST.JLS3 as the AST level in all cases, even when dealing with JDK 1.3 or 1.4..

Parameters:
level - the API level; one of the LEVEL constants
Returns:
new AST instance following the specified set of API rules.
Throws:
java.lang.IllegalArgumentException - if:
  • the API level is not one of the LEVEL constants
Since:
3.0

convertCompilationUnit

public static CompilationUnit convertCompilationUnit(int level,
                                                     CompilationUnitDeclaration compilationUnitDeclaration,
                                                     char[] source,
                                                     java.util.Map options,
                                                     boolean isResolved,
                                                     CompilationUnit workingCopy,
                                                     IProgressMonitor monitor)
Internal method.

This method converts the given internal compiler AST for the given source string into a compilation unit. This method is not intended to be called by clients.

Parameters:
level - the API level; one of the LEVEL constants
compilationUnitDeclaration - an internal AST node for a compilation unit declaration
source - the string of the Java compilation unit
options - compiler options
workingCopy - the working copy that the AST is created from
monitor - the progress monitor used to report progress and request cancelation, or null if none
isResolved - whether the given compilation unit declaration is resolved
Returns:
the compilation unit node

newAspectDeclaration

public AspectDeclaration newAspectDeclaration()
Creates an unparented aspect declaration node owned by this AST. The name of the aspect is an unspecified, but legal, name; no modifiers; no doc comment; no superclass or superinterfaces; an empty body; a null perclause; and is not privileged

To set the perclause, use this method and then call AspectDeclaration.setPerClause(ASTNode).

To create a privileged aspect, use this method and then call AspectDeclaration.setPrivileged(true).

Returns:
a new unparented aspect declaration node

newAjTypeDeclaration

public AjTypeDeclaration newAjTypeDeclaration()
Creates an unparented ajtype declaration node owned by this AST. The name of the class is an unspecified, but legal, name; no modifiers; no doc comment; no superclass or superinterfaces; and an empty body.

To create an aspect, use this method and then call AjTypeDeclaration.setAspect(true).

Returns:
a new unparented ajtype declaration node

newAfterAdviceDeclaration

public AfterAdviceDeclaration newAfterAdviceDeclaration()
Creates an unparented after advice declaration node owned by this AST. By default, the declaration is for an after advice with no pointcut; no doc comment; and no body (as opposed to an empty body).

Returns:
a new unparented after advice declaration node

newAfterReturningAdviceDeclaration

public AfterReturningAdviceDeclaration newAfterReturningAdviceDeclaration()
Creates an unparented after returning advice declaration node owned by this AST. By default, the declaration is for an after returning advice with no pointcut; no doc comment; no return value and no body (as opposed to an empty body).

Returns:
a new unparented after returning advice declaration node

newAfterThrowingAdviceDeclaration

public AfterThrowingAdviceDeclaration newAfterThrowingAdviceDeclaration()
Creates an unparented after throwing advice declaration node owned by this AST. By default, the declaration is for an after throwing advice with no pointcut; no doc comment; no throwing value and no body (as opposed to an empty body).

Returns:
a new unparented after throwing advice declaration node

newBeforeAdviceDeclaration

public BeforeAdviceDeclaration newBeforeAdviceDeclaration()
Creates an unparented before advice declaration node owned by this AST. By default, the declaration is for a before advice with no pointcut; no doc comment; and no body (as opposed to an empty body).

Returns:
a new unparented before advice declaration node

newAroundAdviceDeclaration

public AroundAdviceDeclaration newAroundAdviceDeclaration()
Creates an unparented around advice declaration node owned by this AST. By default, the declaration is for an around advice with no pointcut; no doc comment; no return type; and no body (as opposed to an empty body).

Returns:
a new unparented around advice declaration node

newDeclareAtConstructorDeclaration

public DeclareAtConstructorDeclaration newDeclareAtConstructorDeclaration()
Creates an unparented declare at constructor declaration node owned by this AST. By default, the declaration is for a declare annotation with no doc comment; no pattern node; no annotation name; and no declare kind.

Returns:
a new unparented declare at constructor declaration node
Throws:
java.lang.UnsupportedOperationException - if this operation is used in a JLS2 AST

newDeclareAtFieldDeclaration

public DeclareAtFieldDeclaration newDeclareAtFieldDeclaration()
Creates an unparented declare at field declaration node owned by this AST. By default, the declaration is for a declare annotation with no doc comment; no pattern node; no annotation name; and no declare kind.

Returns:
a new unparented declare at field declaration node
Throws:
java.lang.UnsupportedOperationException - if this operation is used in a JLS2 AST

newDeclareAtMethodDeclaration

public DeclareAtMethodDeclaration newDeclareAtMethodDeclaration()
Creates an unparented declare at method declaration node owned by this AST. By default, the declaration is for a declare annotation with no doc comment; no pattern node; no annotation name; and no declare kind.

Returns:
a new unparented declare at method declaration node
Throws:
java.lang.UnsupportedOperationException - if this operation is used in a JLS2 AST

newDeclareAtTypeDeclaration

public DeclareAtTypeDeclaration newDeclareAtTypeDeclaration()
Creates an unparented declare at type declaration node owned by this AST. By default, the declaration is for a declare annotation with no doc comment; no pattern node; no annotation name; and no declare kind.

Returns:
a new unparented declare at type declaration node
Throws:
java.lang.UnsupportedOperationException - if this operation is used in a JLS2 AST

newDeclareErrorDeclaration

public DeclareErrorDeclaration newDeclareErrorDeclaration()
Creates an unparented declare error declaration node owned by this AST. By default, the declaration is for a declare error with no doc comment; no pointcut; and no message.

Returns:
a new unparented declare error declaration node

newDeclareParentsDeclaration

public DeclareParentsDeclaration newDeclareParentsDeclaration()
Creates an unparented declare parents declaration node owned by this AST. By default, the declaration is for a declare parents which is implements; with no doc comment; no child type pattern; and no parent type pattern

To create an extends declare parents, use this method and then call DeclareParentsDeclaration.setExtends(true).

Returns:
a new unparented declare parents declaration node

newDeclarePrecedenceDeclaration

public DeclarePrecedenceDeclaration newDeclarePrecedenceDeclaration()
Creates an unparented declare precedence declaration node owned by this AST. By default, the declaration is for a declare precedence with no doc comment; and no type pattern list.

Returns:
a new unparented declare precedence declaration node

newDeclareSoftDeclaration

public DeclareSoftDeclaration newDeclareSoftDeclaration()
Creates an unparented declare soft declaration node owned by this AST. By default, the declaration is for a declare soft with no doc comment; no pointcut; and no type pattern.

Returns:
a new unparented declare soft declaration node

newDeclareWarningDeclaration

public DeclareWarningDeclaration newDeclareWarningDeclaration()
Creates an unparented declare warning declaration node owned by this AST. By default, the declaration is for a declare warning with no doc comment; no pointcut; and no message.

Returns:
a new unparented declare warning declaration node

newInterTypeFieldDeclaration

public InterTypeFieldDeclaration newInterTypeFieldDeclaration()
Creates a new unparented intertype field declaration node owned by this AST. By default, there are no modifiers, no doc comment, and the base type is unspecified (but legal).

Returns:
a new unparented intertype field declaration node

newInterTypeMethodDeclaration

public InterTypeMethodDeclaration newInterTypeMethodDeclaration()
Creates an unparented intertype method declaration node owned by this AST. By default, the declaration is for a method of an unspecified, but legal, name; no modifiers; no doc comment; no parameters; return type void; no extra array dimensions; no thrown exceptions; and no body (as opposed to an empty body).

Returns:
a new unparented inter type method declaration node

newPointcutDeclaration

public PointcutDeclaration newPointcutDeclaration()
Creates an unparented pointcut declaration node owned by this AST. By default, the declaration is for a pointcut of an unspecified, but legal, name; no modifiers; no doc comment; and no pointcut designator

Returns:
a new unparented pointcut declaration node

newAndPointcut

public AndPointcut newAndPointcut()
Creates an unparented AndPointcut node owned by this AST. By default, the declaration is for an and pointcut with no left or right pointcut designators

Returns:
a new unparented AndPointcut node

newCflowPointcut

public CflowPointcut newCflowPointcut()
Creates an unparented CflowPointcut node owned by this AST. By default, the declaration is for a cflow pointcut with no body pointcut designator

Returns:
a new unparented CflowPointcut node

newNotPointcut

public NotPointcut newNotPointcut()
Creates an unparented NotPointcut node owned by this AST. By default, the declaration is for a not pointcut with no body pointcut designator

Returns:
a new unparented NotPointcut node

newOrPointcut

public OrPointcut newOrPointcut()
Creates an unparented OrPointcut node owned by this AST. By default, the declaration is for an or pointcut with no left or right pointcut designators

Returns:
a new unparented OrPointcut node

newPerCflow

public PerCflow newPerCflow()
Creates an unparented PerCflow node owned by this AST. By default, the declaration is for a percflow with no body pointcut designator

Returns:
a new unparented percflow node

newPerObject

public PerObject newPerObject()
Creates an unparented perobject node owned by this AST. By default, the declaration is for a perobject with no body pointcut designator

Returns:
a new unparented perobject node

newPerTypeWithin

public PerTypeWithin newPerTypeWithin()
Creates an unparented pertypewithin node owned by this AST. By default, the declaration is for a pertypewithin

Returns:
a new unparented pertypewithin node

newReferencePointcut

public ReferencePointcut newReferencePointcut()
Creates an unparented reference pointcut node owned by this AST. By default, the declaration is for a reference pointcut with no name

Returns:
a new unparented reference pointcut node

newDefaultPointcut

public DefaultPointcut newDefaultPointcut()
Creates an unparented default pointcut node owned by this AST. By default, the declaration is for a default pointcut with an empty detail string.

To edit the detail string, use this method and then call DefaultPointcut.setDetail("newString").

Returns:
a new unparented default pointcut node

newDefaultTypePattern

public DefaultTypePattern newDefaultTypePattern()
Creates an unparented default type pattern node owned by this AST. By default, the declaration is for a default type pattern with an empty detail string.

To edit the detail string, use this method and then call DefaultTypePattern.setDetail("newString").

Returns:
a new unparented default type pattern node

newSignaturePattern

public SignaturePattern newSignaturePattern()
Creates an unparented default signature pattern node owned by this AST. By default, the declaration is for a default signature pattern with an empty detail string.

To edit the detail string, use this method and then call SignaturePattern.setDetail("newString").

Returns:
a new unparented default signature pattern node