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

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

Introduction

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

Prototype

int PARAMETER

To view the source code for org.eclipse.jdt.internal.compiler.ast AbstractVariableDeclaration 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 a  va 2s  . c  om
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).
*///ww  w.  j a  va  2 s  .  com
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;
}