Example usage for org.eclipse.jdt.core.dom Type delete

List of usage examples for org.eclipse.jdt.core.dom Type delete

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom Type delete.

Prototype

public final void delete() 

Source Link

Document

Removes this node from its parent.

Usage

From source file:edu.buffalo.cse.green.relationship.generalization.GeneralizationRemover.java

License:Open Source License

/**
 * @see edu.buffalo.cse.green.relationships.RelationshipVisitor#process(org.eclipse.jdt.core.dom.TypeDeclaration)
 *//* w ww . ja v  a  2s. co m*/
public boolean process(DeclarationInfoProvider node) {
    if (node.isInterface()) {
        IType elementToDelete = getTargetType();
        List<Type> superInterfaceTypes = node.getSuperInterfaceTypes();

        for (Type type : superInterfaceTypes) {
            // check for match on removal
            if (getType(type).equals(elementToDelete)) {
                type.delete();
                break;
            }
        }
    } else {
        node.setSuperclassType(null);
    }

    return true;
}

From source file:edu.buffalo.cse.green.relationship.realization.RealizationRemover.java

License:Open Source License

/**
 * @see edu.buffalo.cse.green.relationships.RelationshipVisitor#process(org.eclipse.jdt.core.dom.TypeDeclaration)
 *//* w  ww .  j  a  v a  2 s.co m*/
public boolean process(DeclarationInfoProvider node) {
    if (node.isInterface()) {
        return true;
    }

    List superInterfaces = node.getSuperInterfaceTypes();

    for (Type type : (AbstractList<Type>) (List) superInterfaces) {
        if (getType(type).equals(getTargetType())) {
            type.delete();
            break;
        }
    }

    return true;
}