Example usage for org.eclipse.jdt.internal.compiler.ast AbstractVariableDeclaration TYPE_PARAMETER

List of usage examples for org.eclipse.jdt.internal.compiler.ast AbstractVariableDeclaration TYPE_PARAMETER

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.ast AbstractVariableDeclaration TYPE_PARAMETER.

Prototype

int TYPE_PARAMETER

To view the source code for org.eclipse.jdt.internal.compiler.ast AbstractVariableDeclaration TYPE_PARAMETER.

Click Source Link

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.search.matching.MatchLocator.java

License:Open Source License

/**
 * Create an handle for a local variable declaration (may be a local variable or type parameter).
 *///w w w . j  av a 2 s.  co  m
protected IJavaElement createHandle(AbstractVariableDeclaration variableDeclaration, IJavaElement parent) {
    switch (variableDeclaration.getKind()) {
    case AbstractVariableDeclaration.LOCAL_VARIABLE:
        if (variableDeclaration.type.resolvedType != null) {
            return new LocalVariable((JavaElement) parent, new String(variableDeclaration.name),
                    variableDeclaration.declarationSourceStart, variableDeclaration.declarationSourceEnd,
                    variableDeclaration.sourceStart, variableDeclaration.sourceEnd,
                    new String(variableDeclaration.type.resolvedType.signature()),
                    variableDeclaration.annotations, variableDeclaration.modifiers, false);
        }
        break;
    case AbstractVariableDeclaration.PARAMETER:
        if (variableDeclaration.type.resolvedType != null) {
            return new LocalVariable((JavaElement) parent, new String(variableDeclaration.name),
                    variableDeclaration.declarationSourceStart, variableDeclaration.declarationSourceEnd,
                    variableDeclaration.sourceStart, variableDeclaration.sourceEnd,
                    new String(variableDeclaration.type.resolvedType.signature()),
                    variableDeclaration.annotations, variableDeclaration.modifiers, true);
        }
        break;
    case AbstractVariableDeclaration.TYPE_PARAMETER:
        return new org.eclipse.jdt.internal.core.TypeParameter((JavaElement) parent,
                new String(variableDeclaration.name));
    }
    return null;
}

From source file:org.eclipse.che.jdt.internal.core.search.matching.MatchLocator.java

License:Open Source License

/**
* Create an handle for a local variable declaration (may be a local variable or type parameter).
*///from  ww w. j  a  v a 2  s  .c  om
protected IJavaElement createHandle(AbstractVariableDeclaration variableDeclaration, IJavaElement parent) {
    boolean isParameter = true;
    switch (variableDeclaration.getKind()) {
    case AbstractVariableDeclaration.LOCAL_VARIABLE:
        isParameter = false;
        //$FALL-THROUGH$
    case AbstractVariableDeclaration.PARAMETER:
        if (variableDeclaration.type.resolvedType != null) {
            return new LocalVariable((JavaElement) parent, new String(variableDeclaration.name),
                    variableDeclaration.declarationSourceStart, variableDeclaration.declarationSourceEnd,
                    variableDeclaration.sourceStart, variableDeclaration.sourceEnd,
                    new String(variableDeclaration.type.resolvedType.signature()),
                    variableDeclaration.annotations, variableDeclaration.modifiers, isParameter,
                    variableDeclaration.type.getAnnotationsOnDimensions());
        }
        break;
    case AbstractVariableDeclaration.TYPE_PARAMETER:
        return new org.eclipse.jdt.internal.core.TypeParameter((JavaElement) parent,
                new String(variableDeclaration.name));
    }
    return null;
}