Example usage for org.eclipse.jdt.internal.compiler.env IBinaryField getGenericSignature

List of usage examples for org.eclipse.jdt.internal.compiler.env IBinaryField getGenericSignature

Introduction

In this page you can find the example usage for org.eclipse.jdt.internal.compiler.env IBinaryField getGenericSignature.

Prototype

char[] getGenericSignature();

Source Link

Document

Answer the receiver's FieldSignature, which describes the field's type as specified in "4.7.9.1 Signatures" of the Java SE 8 VM spec.

Usage

From source file:com.codenvy.ide.ext.java.server.internal.core.BinaryField.java

License:Open Source License

public String getTypeSignature() throws JavaModelException {
    IBinaryField info = (IBinaryField) getElementInfo();
    char[] genericSignature = info.getGenericSignature();
    if (genericSignature != null) {
        return new String(ClassFile.translatedName(genericSignature));
    }//from w  w  w.  ja  v a 2s .  c  o m
    return new String(ClassFile.translatedName(info.getTypeName()));
}

From source file:org.eclipse.che.jdt.BinaryTypeConvector.java

License:Open Source License

private static JsonElement toJsonField(IBinaryField field) {
    JsonObject object = new JsonObject();
    object.addProperty("modifiers", field.getModifiers());
    object.add("constant", toJsonConstant(field.getConstant()));
    object.add("genericSignature", field.getGenericSignature() == null ? JsonNull.INSTANCE
            : new JsonPrimitive(new String(field.getGenericSignature())));
    object.add("name",
            field.getName() == null ? JsonNull.INSTANCE : new JsonPrimitive(new String(field.getName())));
    object.addProperty("tagBits", String.valueOf(field.getTagBits()));
    object.add("typeName", field.getTypeName() == null ? JsonNull.INSTANCE
            : new JsonPrimitive(new String(field.getTypeName())));
    object.add("annotations", toJsonAnnotations(field.getAnnotations()));
    return object;
}