Example usage for org.eclipse.jdt.internal.core SourceType getTypeParameters

List of usage examples for org.eclipse.jdt.internal.core SourceType getTypeParameters

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.core SourceType getTypeParameters.

Prototype

@Override
    public ITypeParameter[] getTypeParameters() throws JavaModelException 

Source Link

Usage

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

License:Open Source License

public ITDAwareSourceTypeInfo(ISourceType toCopy, SourceType type) {
    this.handle = createITDAwareType(type, this);

    this.setFlags(toCopy.getModifiers());
    this.setSuperclassName(toCopy.getSuperclassName());
    this.setSuperInterfaceNames(toCopy.getInterfaceNames());
    this.setNameSourceEnd(toCopy.getNameSourceEnd());
    this.setNameSourceStart(toCopy.getNameSourceStart());
    this.setSourceRangeEnd(toCopy.getDeclarationSourceEnd());
    this.setSourceRangeStart(toCopy.getDeclarationSourceStart());
    try {//from   w  w w.  j ava2 s  .  co m
        ITypeParameter[] parameters = type.getTypeParameters();
        if (parameters != null) {
            this.typeParameters = new ITypeParameter[parameters.length];
            System.arraycopy(parameters, 0, this.typeParameters, 0, parameters.length);
        }
    } catch (JavaModelException e) {
    }

    IJavaElement[] children = augmentChildrenAndHierarchy(type);
    if (children != null) {
        this.setChildren(children);
    }

    try {
        // this ensures that itd aware content assist 
        // still works when there are large numbers ofannotations
        Object info = ((JavaElement) handle.getCompilationUnit()).getElementInfo();
        if (info != null && info instanceof CompilationUnitElementInfo) {
            ((CompilationUnitElementInfo) info).annotationNumber = 0;
        }
    } catch (JavaModelException e) {
    }
}