Java Code Examples for org.eclipse.jdt.core.dom.IMethodBinding#getKey()

The following examples show how to use org.eclipse.jdt.core.dom.IMethodBinding#getKey() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: JdtBasedTypeFactory.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
private SegmentSequence getSignatureAsSegmentSequence(IMethodBinding method) {
	String key = method.getKey();
	int start = key.indexOf('(');
	int end = key.lastIndexOf(')');
	SegmentSequence signaturex = SegmentSequence.create(";", key.substring(start + 1, end));
	return signaturex;
}
 
Example 2
Source File: OverrideMethodsOperation.java    From eclipse.jdt.ls with Eclipse Public License 2.0 5 votes vote down vote up
private static OverridableMethod convertToSerializableMethod(IMethodBinding binding, boolean unimplemented) {
	OverridableMethod result = new OverridableMethod();
	result.bindingKey = binding.getKey();
	result.name = binding.getName();
	result.parameters = getMethodParameterTypes(binding, false);
	result.unimplemented = unimplemented || Modifier.isAbstract(binding.getModifiers());
	result.declaringClass = binding.getDeclaringClass().getQualifiedName();
	result.declaringClassType = binding.getDeclaringClass().isInterface() ? "interface" : "class";
	return result;
}
 
Example 3
Source File: RemoteServiceProblemFactory.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns a new {@link RemoteServiceProblem} for a
 * {@link RemoteServiceProblemType#MISSING_ASYNC_METHOD} on an
 * <b>asynchronous</b> type.
 */
static RemoteServiceProblem newMissingAsyncMethodOnAsync(
    IMethodBinding syncMethodBinding, TypeDeclaration asyncTypeDeclaration) {
  String[] messageArgs = {
      asyncTypeDeclaration.getName().getIdentifier(),
      toAsyncMethodSignature(syncMethodBinding)};
  String[] problemArgs = {"async", syncMethodBinding.getKey()};

  return RemoteServiceProblem.create(asyncTypeDeclaration.getName(),
      RemoteServiceProblemType.MISSING_ASYNC_METHOD, messageArgs, problemArgs);
}
 
Example 4
Source File: RemoteServiceProblemFactory.java    From gwt-eclipse-plugin with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns a new {@link RemoteServiceProblem} for a
 * {@link RemoteServiceProblemType#MISSING_SYNC_METHOD} on a
 * <b>synchronous</b> type.
 */
static RemoteServiceProblem newMissingSyncMethodOnSync(
    TypeDeclaration syncTypeDeclaration, IMethodBinding asyncMethodBinding) {
  String[] messageArgs = {
      syncTypeDeclaration.getName().getIdentifier(),
      toSyncMethodSignature(asyncMethodBinding)};
  String[] problemArgs = {"sync", asyncMethodBinding.getKey()};

  return RemoteServiceProblem.create(syncTypeDeclaration.getName(),
      RemoteServiceProblemType.MISSING_SYNC_METHOD, messageArgs, problemArgs);
}
 
Example 5
Source File: ParameterTypeVariable2.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public ParameterTypeVariable2(TType type, int index, IMethodBinding binding) {
	super(type);
	Assert.isNotNull(binding);
	Assert.isTrue(0 <= index);
	fParameterIndex= index;
	fKey= binding.getKey();
}
 
Example 6
Source File: ConstraintVariableFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public DeclaringTypeVariable makeDeclaringTypeVariable(IMethodBinding methodBinding) {
	String key= methodBinding.getKey();
	if (! fDeclaringTypeVariableMap.containsKey(key)){
		fDeclaringTypeVariableMap.put(key, new DeclaringTypeVariable(methodBinding));
		if (REPORT) nrCreated++;
	} else {
		if (REPORT) nrRetrieved++;
	}
	if (REPORT) dumpConstraintStats();
	return fDeclaringTypeVariableMap.get(key);
}
 
Example 7
Source File: ConstraintVariableFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public ParameterTypeVariable makeParameterTypeVariable(IMethodBinding methodBinding,
													   int parameterIndex) {
	String key= methodBinding.getKey() + parameterIndex;
	if (! fParameterMap.containsKey(key)){
		fParameterMap.put(key, new ParameterTypeVariable(methodBinding, parameterIndex));
		if (REPORT) nrCreated++;
	} else {
		if (REPORT) nrRetrieved++;
	}
	if (REPORT) dumpConstraintStats();
	return fParameterMap.get(key);
}
 
Example 8
Source File: ConstraintVariableFactory.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 5 votes vote down vote up
public ReturnTypeVariable makeReturnTypeVariable(IMethodBinding methodBinding) {
	String key= methodBinding.getKey();
	if (!fReturnVariableMap.containsKey(key)){
		fReturnVariableMap.put(key, new ReturnTypeVariable(methodBinding));
		if (REPORT) nrCreated++;
	} else {
		if (REPORT) nrRetrieved++;
	}
	if (REPORT) dumpConstraintStats();
	return fReturnVariableMap.get(key);
}
 
Example 9
Source File: JdtDomModels.java    From eclipse.jdt.ls with Eclipse Public License 2.0 4 votes vote down vote up
public LspMethodBinding(IMethodBinding binding) {
	this.bindingKey = binding.getKey();
	this.name = binding.getName();
	this.parameters = Stream.of(binding.getParameterTypes()).map(type -> type.getName()).toArray(String[]::new);
}
 
Example 10
Source File: ReturnTypeVariable2.java    From Eclipse-Postfix-Code-Completion with Eclipse Public License 1.0 4 votes vote down vote up
public ReturnTypeVariable2(TType type, IMethodBinding binding) {
	super(type);
	fKey= binding.getKey();
}