Example usage for org.eclipse.jdt.core.compiler ITerminalSymbols TokenNamefinal

List of usage examples for org.eclipse.jdt.core.compiler ITerminalSymbols TokenNamefinal

Introduction

In this page you can find the example usage for org.eclipse.jdt.core.compiler ITerminalSymbols TokenNamefinal.

Prototype

int TokenNamefinal

To view the source code for org.eclipse.jdt.core.compiler ITerminalSymbols TokenNamefinal.

Click Source Link

Usage

From source file:com.google.googlejavaformat.java.ModifierOrderer.java

License:Apache License

/**
 * Returns the {@link javax.lang.model.element.Modifier} for the given token id, or {@code null}.
 *//* ww  w . j a v a  2  s .c  om*/
static Modifier getModifier(int tokenId) {
    switch (tokenId) {
    case ITerminalSymbols.TokenNamepublic:
        return Modifier.PUBLIC;
    case ITerminalSymbols.TokenNameprotected:
        return Modifier.PROTECTED;
    case ITerminalSymbols.TokenNameprivate:
        return Modifier.PRIVATE;
    case ITerminalSymbols.TokenNameabstract:
        return Modifier.ABSTRACT;
    case ITerminalSymbols.TokenNamestatic:
        return Modifier.STATIC;
    case ITerminalSymbols.TokenNamedefault:
        return Modifier.DEFAULT;
    case ITerminalSymbols.TokenNamefinal:
        return Modifier.FINAL;
    case ITerminalSymbols.TokenNametransient:
        return Modifier.TRANSIENT;
    case ITerminalSymbols.TokenNamevolatile:
        return Modifier.VOLATILE;
    case ITerminalSymbols.TokenNamesynchronized:
        return Modifier.SYNCHRONIZED;
    case ITerminalSymbols.TokenNamenative:
        return Modifier.NATIVE;
    case ITerminalSymbols.TokenNamestrictfp:
        return Modifier.STRICTFP;
    default:
        return null;
    }
}