Example usage for org.aspectj.asm IProgramElement isAnnotationRemover

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

Introduction

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

Prototype

public boolean isAnnotationRemover();

Source Link

Usage

From source file:org.eclipse.ajdt.core.javaelements.DeclareElement.java

License:Open Source License

protected Object createElementInfo() {
    try {//w ww  .ja v  a2 s.c  o  m
        IProgramElement ipe = AJProjectModelFactory.getInstance().getModelForJavaElement(this)
                .javaElementToProgramElement(this);

        DeclareElementInfo elementInfo = new DeclareElementInfo();
        if (ipe != IHierarchy.NO_STRUCTURE) {
            elementInfo.setSourceRangeStart(ipe.getSourceLocation().getOffset());
            elementInfo.setName(name.toCharArray());
            elementInfo.setAJKind(getKindForString(name));

            List<String> types = ipe.getParentTypes();
            if (types != null) {
                List<String> typesConverted = new ArrayList<String>(types.size());
                for (String parentTypeName : types) {

                    parentTypeName = parentTypeName.replaceAll("\\$", "\\.");
                    typesConverted.add(parentTypeName);
                }
                elementInfo.setTypes((String[]) typesConverted.toArray(new String[typesConverted.size()]));
            }

            elementInfo.setAnnotationRemover(ipe.isAnnotationRemover());
        }
        return elementInfo;
    } catch (Exception e) {
        // can fail for any of a number of reasons.
        // return null so that we can try again later.
        return null;
    }
}