Package org.aspectj.asm

Examples of org.aspectj.asm.IProgramElement.removeChild()


          IProgramElement parent = typeElement.getParent();
          // parent may have children: PACKAGE DECL, IMPORT-REFERENCE, TYPE_DECL
          if (parent != null) {
            // if it was the only type we should probably remove
            // the others too.
            parent.removeChild(typeElement);
            if (parent.getKind().isSourceFile()) {
              removeSourceFileIfNoMoreTypeDeclarationsInside(hierarchy, typeElement, parent);
            } else {
              hierarchy.forget(null, typeElement);
              // At this point, the child has been removed. We
View Full Code Here


    // had something removed
    if (candidatesForRemoval.contains(typeThatHasChildRemoved) && !hasInnerType(typeThatHasChildRemoved)) {
      // now we can get rid of it
      IProgramElement parent = typeThatHasChildRemoved.getParent();
      if (parent != null) {
        parent.removeChild(typeThatHasChildRemoved);
        candidatesForRemoval.remove(typeThatHasChildRemoved);
        if (parent.getKind().isSourceFile()) {
          removeSourceFileIfNoMoreTypeDeclarationsInside(hierarchy, typeThatHasChildRemoved, parent);
          // System.out.println("Removed on second pass: " +
          // typeThatHasChildRemoved.getName());
View Full Code Here

    // other types, there is no need to keep it
    if (!anyOtherTypeDeclarations) {
      IProgramElement cuParent = compilationUnit.getParent();
      if (cuParent != null) {
        compilationUnit.setParent(null);
        cuParent.removeChild(compilationUnit);
      }
      // need to update some caches and structures too?
      hierarchy.forget(sourceFileNode, typeElement);
    } else {
      hierarchy.forget(null, typeElement);
View Full Code Here

          IProgramElement parent = typeElement.getParent();
          // parent may have children: PACKAGE DECL, IMPORT-REFERENCE, TYPE_DECL
          if (parent != null) {
            // if it was the only type we should probably remove
            // the others too.
            parent.removeChild(typeElement);
            if (parent.getKind().isSourceFile()) {
              removeSourceFileIfNoMoreTypeDeclarationsInside(hierarchy, typeElement, parent);
            } else {
              hierarchy.forget(null, typeElement);
              // At this point, the child has been removed. We
View Full Code Here

    // had something removed
    if (candidatesForRemoval.contains(typeThatHasChildRemoved) && !hasInnerType(typeThatHasChildRemoved)) {
      // now we can get rid of it
      IProgramElement parent = typeThatHasChildRemoved.getParent();
      if (parent != null) {
        parent.removeChild(typeThatHasChildRemoved);
        candidatesForRemoval.remove(typeThatHasChildRemoved);
        if (parent.getKind().isSourceFile()) {
          removeSourceFileIfNoMoreTypeDeclarationsInside(hierarchy, typeThatHasChildRemoved, parent);
          // System.out.println("Removed on second pass: " +
          // typeThatHasChildRemoved.getName());
View Full Code Here

    // other types, there is no need to keep it
    if (!anyOtherTypeDeclarations) {
      IProgramElement cuParent = compilationUnit.getParent();
      if (cuParent != null) {
        compilationUnit.setParent(null);
        cuParent.removeChild(compilationUnit);
      }
      // need to update some caches and structures too?
      hierarchy.forget(sourceFileNode, typeElement);
    } else {
      hierarchy.forget(null, typeElement);
View Full Code Here

      pkgNode.addChild(classFileNode);
      for (IProgramElement element: pkgNode.getChildren()) {
        if (!element.equals(classFileNode) && element.getHandleIdentifier().equals(classFileNode.getHandleIdentifier())) {
          // already added the classfile so have already
          // added the structure for this aspect
          pkgNode.removeChild(classFileNode);
          return;
        }
      }
    }
    // } else {
View Full Code Here

      pkgNode.addChild(classFileNode);
      for (IProgramElement element: pkgNode.getChildren()) {
        if (!element.equals(classFileNode) && element.getHandleIdentifier().equals(classFileNode.getHandleIdentifier())) {
          // already added the classfile so have already
          // added the structure for this aspect
          pkgNode.removeChild(classFileNode);
          return;
        }
      }
    }
    // } else {
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.