List of usage examples for org.eclipse.jdt.internal.compiler.lookup MethodBinding getDefaultValue
public Object getDefaultValue()
From source file:com.codenvy.ide.ext.java.server.TypeBindingConvector.java
License:Open Source License
private static JsonElement toJsonMethod(MethodBinding method) { JsonObject object = new JsonObject(); object.addProperty("modifiers", method.getAccessFlags()); object.addProperty("constructor", method.isConstructor()); object.add("argumentNames", toJsonParametersName(method.sourceMethod())); object.add("annotations", toJsonAnnotations(method.getAnnotations())); object.add("defaultValue", toJsonDefaultValue(method.getDefaultValue())); object.add("exceptionTypeNames", toJsonExceptionTypeNames(method.thrownExceptions)); object.add("genericSignature", method.genericSignature() == null ? JsonNull.INSTANCE : new JsonPrimitive(new String(method.genericSignature()))); object.add("methodDescriptor", method.signature() == null ? JsonNull.INSTANCE : new JsonPrimitive(new String(method.signature()))); object.add("parameterAnnotations", toJsonParameterAnnotations(method)); object.add("selector", method.selector == null ? JsonNull.INSTANCE : new JsonPrimitive(new String(method.selector))); object.addProperty("tagBits", String.valueOf(method.getAnnotationTagBits())); object.addProperty("clinit", false); return object; }
From source file:com.redhat.ceylon.eclipse.core.model.mirror.JDTMethod.java
License:Open Source License
public JDTMethod(JDTClass enclosingClass, MethodBinding method) { this.enclosingClass = enclosingClass; bindingRef = new WeakReference<MethodBinding>(method); name = new String(method.selector); readableName = new String(method.readableName()); isStatic = method.isStatic();// w ww . j a v a2 s . c o m isPublic = method.isPublic(); isConstructor = method.isConstructor(); isStaticInit = method.selector == TypeConstants.CLINIT; // TODO : check if it is right isAbstract = method.isAbstract(); isFinal = method.isFinal(); isProtected = method.isProtected(); isDefaultAccess = method.isDefault(); isDeclaredVoid = method.returnType.id == TypeIds.T_void; isVariadic = method.isVarargs(); isDefault = method.getDefaultValue() != null; bindingKey = method.computeUniqueKey(); if (method instanceof ProblemMethodBinding) { annotations = new HashMap<>(); parameters = Collections.emptyList(); returnType = JDTType.UNKNOWN_TYPE; typeParameters = Collections.emptyList(); isOverriding = false; isOverloading = false; } }