Example usage for org.eclipse.jdt.core.dom SwitchCase SwitchCase

List of usage examples for org.eclipse.jdt.core.dom SwitchCase SwitchCase

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.dom SwitchCase SwitchCase.

Prototype

SwitchCase(AST ast) 

Source Link

Document

Creates a new AST node for a switch case pseudo-statement owned by the given AST.

Usage

From source file:org.eclipse.jdt.core.dom.ASTConverter.java

License:Open Source License

public SwitchCase convert(org.eclipse.jdt.internal.compiler.ast.CaseStatement statement) {
    SwitchCase switchCase = new SwitchCase(this.ast);
    org.eclipse.jdt.internal.compiler.ast.Expression constantExpression = statement.constantExpression;
    if (constantExpression == null) {
        switchCase.setExpression(null);// www.  j  a v a2  s .co m
    } else {
        switchCase.setExpression(convert(constantExpression));
    }
    switchCase.setSourceRange(statement.sourceStart, statement.sourceEnd - statement.sourceStart + 1);
    retrieveColonPosition(switchCase);
    return switchCase;
}