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

public class AjAST extends AST
  • Method Details

    • newAjAST

      public static AjAST newAjAST(int level, boolean previewEnabled)
      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:
      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, Map options, boolean isResolved, CompilationUnit workingCopy, org.eclipse.core.runtime.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:
      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:
      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:
      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:
      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