Example usage for org.eclipse.jdt.internal.compiler.lookup Binding shortReadableName

List of usage examples for org.eclipse.jdt.internal.compiler.lookup Binding shortReadableName

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.lookup Binding shortReadableName.

Prototype

public char[] shortReadableName() 

Source Link

Usage

From source file:org.eclipse.recommenders.utils.rcp.CompilerBindings.java

License:Open Source License

public static Optional<String> getVariableName(final Binding node) {
    if (node == null) {
        return absent();
    }//from  ww w . ja v  a 2 s . co m
    switch (node.kind()) {
    case Binding.FIELD:
    case Binding.LOCAL:
        return of(String.valueOf(node.shortReadableName()));
    }
    return absent();
}