Example usage for org.aspectj.asm IProgramElement getDetails

List of usage examples for org.aspectj.asm IProgramElement getDetails

Introduction

In this page you can find the example usage for org.aspectj.asm IProgramElement getDetails.

Prototype

public String getDetails();

Source Link

Usage

From source file:org.eclipse.ajdt.internal.ui.refactoring.PushInRefactoring.java

License:Open Source License

private String getTextForDeclare(DeclareElement itd) throws JavaModelException {
    IProgramElement ipe = getModel(itd).javaElementToProgramElement(itd);
    if (ipe != null) {
        String details = ipe.getDetails();
        int colonIndex = details.indexOf(':');
        String text = details.substring(colonIndex + 1).trim();
        if (itd.getAJKind() == Kind.DECLARE_ANNOTATION_AT_TYPE) {
            // assume top level type
            return text + "\n";
        } else {/*w  ww  .ja v a  2s .c o m*/
            return text + "\n\t";
        }
    } else {
        throw new RuntimeException(
                "Could not find program element in AspectJ model for " + itd.getHandleIdentifier());
    }
}