Examples of AbstractMethodDeclaration


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

        if (typeBinding != null) {
          return typeBinding.getPackage();
        }
      }
    } else if (node instanceof AbstractMethodDeclaration) {
      AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) node;
      IMethodBinding methodBinding = this.getMethodBinding(methodDeclaration.binding);
      if (methodBinding != null) {
        return methodBinding;
      }
    } else if (node instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) {
View Full Code Here

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

    int fieldIndex = 0, fieldCount = (typeDeclaration.fields == null) ? 0 : typeDeclaration.fields.length;
    FieldDeclaration field = fieldCount == 0 ? null : typeDeclaration.fields[fieldIndex];
    int fieldStart = field == null ? Integer.MAX_VALUE : field.declarationSourceStart;

    int methodIndex = 0, methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
    AbstractMethodDeclaration method = methodCount == 0 ? null : typeDeclaration.methods[methodIndex];
    int methodStart = method == null ? Integer.MAX_VALUE : method.declarationSourceStart;

    int typeIndex = 0, typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;
    TypeDeclaration type = typeCount == 0 ? null : typeDeclaration.memberTypes[typeIndex];
    int typeStart = type == null ? Integer.MAX_VALUE : type.declarationSourceStart;
 
    final int memberLength = fieldCount+methodCount+typeCount;
    ASTNode[] members = new ASTNode[memberLength];
    if (memberLength != 0) {
      int index = 0;
      int previousFieldStart = -1;
      do {
        if (fieldStart < methodStart && fieldStart < typeStart) {
          if (field.getKind() == AbstractVariableDeclaration.ENUM_CONSTANT) {
            // filter out enum constants
            previousFieldStart = fieldStart;
            if (++fieldIndex < fieldCount) { // find next field if any
              fieldStart = (field = typeDeclaration.fields[fieldIndex]).declarationSourceStart;
            } else {
              fieldStart = Integer.MAX_VALUE;
            }
            continue;
          }
          // next member is a field
          if (fieldStart == previousFieldStart){
            ASTNode previousMember = members[index - 1];
            if (previousMember instanceof MultiFieldDeclaration) {
              MultiFieldDeclaration multiField = (MultiFieldDeclaration) previousMember;
              int length = multiField.declarations.length;
              System.arraycopy(multiField.declarations, 0, multiField.declarations=new FieldDeclaration[length+1], 0, length);
              multiField.declarations[length] = field;
            } else {
              FieldDeclaration fieldDeclaration = (FieldDeclaration)previousMember;
              final MultiFieldDeclaration multiFieldDeclaration = new MultiFieldDeclaration(new FieldDeclaration[]{ fieldDeclaration, field});
              multiFieldDeclaration.annotations = fieldDeclaration.annotations;
              members[index - 1] = multiFieldDeclaration;
            }
          } else {
            members[index++] = field;
          }
          previousFieldStart = fieldStart;
          if (++fieldIndex < fieldCount) { // find next field if any
            fieldStart = (field = typeDeclaration.fields[fieldIndex]).declarationSourceStart;
          } else {
            fieldStart = Integer.MAX_VALUE;
          }
        } else if (methodStart < fieldStart && methodStart < typeStart) {
          // next member is a method
          if (!method.isDefaultConstructor() && !method.isClinit()) {
            members[index++] = method;         
          }
          if (++methodIndex < methodCount) { // find next method if any
            methodStart = (method = typeDeclaration.methods[methodIndex]).declarationSourceStart;
          } else {
View Full Code Here

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

    int methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
    int typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;
 
    if (methodCount <= 2) {
      for (int i = 0, max = methodCount; i < max; i++) {
        final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration.methods[i];
        if (abstractMethodDeclaration.isDefaultConstructor()) {
          methodCount--;
        } else if (abstractMethodDeclaration.isClinit()) {
          methodCount--;
        }
      }
    }
    final int memberLength = fieldCount + methodCount+typeCount;
View Full Code Here

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

    int methodCount = (typeDeclaration.methods == null) ? 0 : typeDeclaration.methods.length;
    int typeCount = (typeDeclaration.memberTypes == null) ? 0 : typeDeclaration.memberTypes.length;
 
    if (methodCount <= 2) {
      for (int i = 0, max = methodCount; i < max; i++) {
        final AbstractMethodDeclaration abstractMethodDeclaration = typeDeclaration.methods[i];
        if (abstractMethodDeclaration.isDefaultConstructor()) {
          methodCount--;
        } else if (abstractMethodDeclaration.isClinit()) {
          methodCount--;
        }
      }
    }
    final int memberLength = fieldCount + methodCount + typeCount;
View Full Code Here

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

    binding.methods(); // the important side-effect of this call is to make
    // sure bindings are completed
    AbstractMethodDeclaration[] methods = declaration.methods;
    if (methods != null) {
      for (int i = 0, len = methods.length; i < len; i++) {
        AbstractMethodDeclaration amd = methods[i];
        if (amd == null || amd.ignoreFurtherInvestigation) {
          continue;
        }
        if (amd instanceof PointcutDeclaration) {
          PointcutDeclaration d = (PointcutDeclaration) amd;
View Full Code Here

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

        } else {
          // we can create a new FieldDeclaration
          typeDecl.bodyDeclarations().add(convertToFieldDeclaration(fieldDeclaration));
        }
      } else if (node instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration) {
        AbstractMethodDeclaration nextMethodDeclaration = (AbstractMethodDeclaration) node;
        if (!nextMethodDeclaration.isDefaultConstructor() && !nextMethodDeclaration.isClinit()) {
          typeDecl.bodyDeclarations().add(convert(nextMethodDeclaration));
        }
      } else if (node instanceof org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) {
        org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration nextMemberDeclaration = (org.aspectj.org.eclipse.jdt.internal.compiler.ast.TypeDeclaration) node;
        ASTNode nextMemberDeclarationNode = convert(nextMemberDeclaration);
View Full Code Here

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

        } else {
          return typeDecl.initializerScope;
        }
      }
    }
    AbstractMethodDeclaration abstractMethodDeclaration = (AbstractMethodDeclaration) this.ast.getBindingResolver()
        .getCorrespondingNode(currentNode);
    return abstractMethodDeclaration.scope;
  }
View Full Code Here

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

  boolean hasAbstractMethods = false;
  int defaultConstructorIndex = -1;
  if (methodCount > 0){
    AbstractMethodDeclaration[] methodDeclarations = new AbstractMethodDeclaration[existingCount + methodCount];
    for (int i = 0; i < existingCount; i++){
      AbstractMethodDeclaration m = typeDeclaration.methods[i];
      if (m.isDefaultConstructor()) defaultConstructorIndex = i;
      if (m.isAbstract()) hasAbstractMethods = true;
      methodDeclarations[i] = m;
    }
    // may need to update the declarationSourceEnd of the last method
    if (methods[methodCount - 1].methodDeclaration.declarationSourceEnd == 0){
      int bodyEndValue = bodyEnd();
      methods[methodCount - 1].methodDeclaration.declarationSourceEnd = bodyEndValue;
      methods[methodCount - 1].methodDeclaration.bodyEnd = bodyEndValue;
    }
    for (int i = 0; i < methodCount; i++){
      AbstractMethodDeclaration updatedMethod = methods[i].updatedMethodDeclaration();     
      if (updatedMethod.isConstructor()) hasRecoveredConstructor = true;
      if (updatedMethod.isAbstract()) hasAbstractMethods = true;
      methodDeclarations[existingCount + i] = updatedMethod;     
    }
    typeDeclaration.methods = methodDeclarations;
    if(methodDeclarations[methodDeclarations.length - 1].declarationSourceEnd > lastEnd) {
      lastEnd = methodDeclarations[methodDeclarations.length - 1].declarationSourceEnd;
View Full Code Here

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

    SourceTypeBinding stb = (SourceTypeBinding) tb;
    Annotation[] toAdd = null;
    long abits = 0;

    AbstractMethodDeclaration methodDecl = null;
    // Might have to retrieve the annotation through BCEL and construct an
    // eclipse one for it.
    if (stb instanceof BinaryTypeBinding) {
      toAdd = retrieveAnnotationFromBinaryTypeBinding(decA, stb);
      if (toAdd != null && toAdd.length > 0 && toAdd[0].resolvedType != null) {
View Full Code Here

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

    // !!! can't do this if we want incremental to work right
    // if (concrete instanceof EclipseTypeMunger) return (EclipseTypeMunger)concrete;
    // System.err.println("   was not eclipse");

    if (concrete.getMunger() != null && EclipseTypeMunger.supportsKind(concrete.getMunger().getKind())) {
      AbstractMethodDeclaration method = null;
      if (concrete instanceof EclipseTypeMunger) {
        method = ((EclipseTypeMunger) concrete).getSourceMethod();
      }
      EclipseTypeMunger ret = new EclipseTypeMunger(this, concrete.getMunger(), concrete.getAspectType(), method);
      if (ret.getSourceLocation() == null) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.