Package org.aspectj.org.eclipse.jdt.internal.compiler.ast

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration


  /**
   * Applies any intertype member type declarations up front.
   */
  private void processInterTypeMemberTypes(ClassScope classScope) {
    TypeDeclaration dec = classScope.referenceContext;
    if (dec instanceof AspectDeclaration) {
      ((AspectDeclaration) dec).processIntertypeMemberTypes(classScope);
    }
    // if we are going to support nested aspects making itd member types, copy the logic from the end of
    // buildInterTypeAndPerClause() which walks members
View Full Code Here


    // if we are going to support nested aspects making itd member types, copy the logic from the end of
    // buildInterTypeAndPerClause() which walks members
  }

  private void buildInterTypeAndPerClause(ClassScope s) {
    TypeDeclaration dec = s.referenceContext;
    if (dec instanceof AspectDeclaration) {
      ((AspectDeclaration) dec).buildInterTypeAndPerClause(s);
    }

    SourceTypeBinding sourceType = s.referenceContext.binding;
View Full Code Here

        if (toAdd != null && toAdd.length > 0 && toAdd[0].resolvedType != null) {
          abits = toAdd[0].resolvedType.getAnnotationTagBits();
        }
      } else {
        abits = mbs[0].getAnnotationTagBits(); // ensure resolved
        TypeDeclaration typeDecl = ((SourceTypeBinding) declaringBinding).scope.referenceContext;
        methodDecl = typeDecl.declarationOf(mbs[0]);
        toAdd = methodDecl.annotations; // this is what to add
        toAdd[0] = createAnnotationCopy(toAdd[0]);
        if (toAdd[0].resolvedType != null) {
          abits = toAdd[0].resolvedType.getAnnotationTagBits();
          // }
View Full Code Here

        LocalDeclaration localDeclaration = (LocalDeclaration) updatedStatement;
        if(localDeclaration.declarationSourceEnd > lastEnd) {
          lastEnd = localDeclaration.declarationSourceEnd;
        }
      } else if (updatedStatement instanceof TypeDeclaration) {
        TypeDeclaration typeDeclaration = (TypeDeclaration) updatedStatement;
        if(typeDeclaration.declarationSourceEnd > lastEnd) {
          lastEnd = typeDeclaration.declarationSourceEnd;
        }
      } else {
        if (updatedStatement.sourceEnd > lastEnd) {
View Full Code Here

  public Shadow makeShadow(ReferenceContext context) {
    return EclipseShadow.makeShadow(this, (ASTNode) context, context);
  }

  public void addSourceTypeBinding(SourceTypeBinding binding, CompilationUnitDeclaration unit) {
    TypeDeclaration decl = binding.scope.referenceContext;

    // Deal with the raw/basic type to give us an entry in the world type map
    UnresolvedType simpleTx = null;
    if (binding.isGenericType()) {
      simpleTx = UnresolvedType.forRawTypeName(getName(binding));
View Full Code Here

    classFile.addDefaultAbstractMethods();
  }
  // propagate generation of (problem) member types
  if (typeDeclaration.memberTypes != null) {
    for (int i = 0, max = typeDeclaration.memberTypes.length; i < max; i++) {
      TypeDeclaration memberType = typeDeclaration.memberTypes[i];
      if (memberType.binding != null) {
        ClassFile.createProblemType(memberType, unitResult);
      }
    }
  }
View Full Code Here

      return argumentNames;
    }
    if (realBinding instanceof FieldBinding) {
      argumentNames = NO_ARGS;
    } else {
      TypeDeclaration typeDecl = getTypeDeclaration();
      AbstractMethodDeclaration methodDecl = (typeDecl == null ? null : typeDecl.declarationOf((MethodBinding) realBinding));
      Argument[] args = (methodDecl == null ? null : methodDecl.arguments); // dont
      // like
      // this
      // -
      // why
View Full Code Here

   * the member (field/method) then grabbing the annotations.
   *
   * @return an array of (eclipse form) annotations on this member
   */
  private Annotation[] getEclipseAnnotations() {
    TypeDeclaration tDecl = getTypeDeclaration();
    // two possible reasons for it being null:
    // 1. code is broken
    // 2. this resolvedmember is an EclipseResolvedMember created up front to represent a privileged'd accessed member
    if (tDecl != null) {
      if (realBinding instanceof MethodBinding) {
        MethodBinding methodBinding = (MethodBinding) realBinding;
        AbstractMethodDeclaration methodDecl = tDecl.declarationOf(methodBinding);
        if (methodDecl == null) {
          // pr284862
          // bindings may have been trashed by InterTypeMemberFinder.addInterTypeMethod() - and so we need to take
          // a better look. Really this EclipseResolvedMember is broken...

          // Grab the set of bindings with matching selector
          MethodBinding[] mb = ((MethodBinding) realBinding).declaringClass.getMethods(methodBinding.selector);
          if (mb != null) {
            for (int m = 0, max = mb.length; m < max; m++) {
              MethodBinding candidate = mb[m];
              if (candidate instanceof InterTypeMethodBinding) {
                if (InterTypeMemberFinder.matches(mb[m], methodBinding)) {
                  InterTypeMethodBinding intertypeMethodBinding = (InterTypeMethodBinding) candidate;
                  Annotation[] annos = intertypeMethodBinding.sourceMethod.annotations;
                  return annos;
                }
              }
            }
          }
          return null; // give up! kind of assuming here that the code has other problems (and they will be reported)
        }
        return methodDecl.annotations;
      } else if (realBinding instanceof FieldBinding) {
        FieldDeclaration fieldDecl = tDecl.declarationOf((FieldBinding) realBinding);
        return fieldDecl.annotations;
      }
    }
    return null;
  }
View Full Code Here

      case Scope.METHOD_SCOPE :
        IType parentType = (IType) createElement(scope.parent, elementPosition, unit, existingElements, knownScopes);
        MethodScope methodScope = (MethodScope) scope;
        if (methodScope.isInsideInitializer()) {
          // inside field or initializer, must find proper one
          TypeDeclaration type = methodScope.referenceType();
          int occurenceCount = 1;
          for (int i = 0, length = type.fields.length; i < length; i++) {
            FieldDeclaration field = type.fields[i];
            if (field.declarationSourceStart < elementPosition && field.declarationSourceEnd > elementPosition) {
              switch (field.getKind()) {
View Full Code Here

  }

  protected void consumeAspectHeaderName(boolean isPrivileged) {
    // (isPrivileged == false) -> AspectHeaderName ::= Modifiersopt 'aspect' 'Identifier'
    // (isPrivileged == true) -> AspectHeaderName ::= Modifiersopt 'privileged' Modifiersopt 'aspect' 'Identifier'
    TypeDeclaration aspectDecl = declarationFactory.createAspect(this.compilationUnit.compilationResult);
    if (this.nestedMethod[this.nestedType] == 0) {
      if (this.nestedType != 0) {
        aspectDecl.bits |= ASTNode.IsMemberType;
      }
    } else {
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.