org.eclipse.jdt.core.Signature.createMethodSignature()方法的使用及代码示例

x33g5p2x  于2022-01-30 转载在 其他  
字(9.2k)|赞(0)|评价(0)|浏览(111)

本文整理了Java中org.eclipse.jdt.core.Signature.createMethodSignature()方法的一些代码示例,展示了Signature.createMethodSignature()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Signature.createMethodSignature()方法的具体详情如下:
包路径:org.eclipse.jdt.core.Signature
类名称:Signature
方法名:createMethodSignature

Signature.createMethodSignature介绍

[英]Creates a method signature from the given parameter and return type signatures. The encoded method signature is dot-based. This method is equivalent to createMethodSignature(parameterTypes, returnType).
[中]从给定参数和返回类型签名创建方法签名。编码的方法签名是基于点的。此方法相当于createMethodSignature(parameterTypes, returnType)

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  return Signature.createMethodSignature(this.parameterTypes, this.returnTypeString);
}
/**

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * @see IMethod
 */
@Override
public String getSignature() throws JavaModelException {
  return Signature.createMethodSignature(this.parameterTypes, this.returnTypeString);
}
/**

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  return Signature.createMethodSignature(this.parameterTypes, this.returnTypeString);
}
/**

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  return Signature.createMethodSignature(this.parameterTypes, this.returnTypeString);
}
/**

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  return Signature.createMethodSignature(this.parameterTypes, this.returnTypeString);
}
/**

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Creates a method signature from the given parameter and return type
 * signatures. The encoded method signature is dot-based. This method
 * is equivalent to
 * <code>createMethodSignature(parameterTypes, returnType)</code>.
 *
 * @param parameterTypes the list of parameter type signatures
 * @param returnType the return type signature
 * @return the encoded method signature
 * @see Signature#createMethodSignature(char[][], char[])
 */
public static String createMethodSignature(String[] parameterTypes, String returnType) {
  int parameterTypesLenth = parameterTypes.length;
  char[][] parameters = new char[parameterTypesLenth][];
  for (int i = 0; i < parameterTypesLenth; i++) {
    parameters[i] = parameterTypes[i].toCharArray();
  }
  return new String(createMethodSignature(parameters, returnType.toCharArray()));
}
/**

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

/**
 * Creates a method signature from the given parameter and return type
 * signatures. The encoded method signature is dot-based. This method
 * is equivalent to
 * <code>createMethodSignature(parameterTypes, returnType)</code>.
 *
 * @param parameterTypes the list of parameter type signatures
 * @param returnType the return type signature
 * @return the encoded method signature
 * @see Signature#createMethodSignature(char[][], char[])
 */
public static String createMethodSignature(String[] parameterTypes, String returnType) {
  int parameterTypesLenth = parameterTypes.length;
  char[][] parameters = new char[parameterTypesLenth][];
  for (int i = 0; i < parameterTypesLenth; i++) {
    parameters[i] = parameterTypes[i].toCharArray();
  }
  return new String(createMethodSignature(parameters, returnType.toCharArray()));
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo();
  return Signature.createMethodSignature(this.parameterTypes, Signature.createTypeSignature(info.getReturnTypeName(), false));
}
/**

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnTypeSignature) {
  char[][] parameterTypeSignature = new char[parameterTypeNames.length][];
  for (int i = 0; i < parameterTypeSignature.length; i++) {
    parameterTypeSignature[i] =
      Signature.createCharArrayTypeSignature(
          CharOperation.concat(
              parameterPackageNames[i],
              CharOperation.replaceOnCopy(parameterTypeNames[i], '.', '$'), '.'), true);
  }
  return Signature.createMethodSignature(
      parameterTypeSignature,
      returnTypeSignature);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * @see IMethod
 */
@Override
public String getSignature() throws JavaModelException {
  SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo();
  return Signature.createMethodSignature(this.parameterTypes, Signature.createTypeSignature(info.getReturnTypeName(), false));
}
/**

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo();
  return Signature.createMethodSignature(this.parameterTypes, Signature.createTypeSignature(info.getReturnTypeName(), false));
}
/**

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo();
  return Signature.createMethodSignature(this.parameterTypes, Signature.createTypeSignature(info.getReturnTypeName(), false));
}
/**

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnTypeSignature) {
  char[][] parameterTypeSignature = new char[parameterTypeNames.length][];
  for (int i = 0; i < parameterTypeSignature.length; i++) {
    parameterTypeSignature[i] =
      Signature.createCharArrayTypeSignature(
          CharOperation.concat(
              parameterPackageNames[i],
              CharOperation.replaceOnCopy(parameterTypeNames[i], '.', '$'), '.'), true);
  }
  return Signature.createMethodSignature(
      parameterTypeSignature,
      returnTypeSignature);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo();
  return Signature.createMethodSignature(this.parameterTypes, Signature.createTypeSignature(info.getReturnTypeName(), false));
}
/**

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnTypeSignature) {
  char[][] parameterTypeSignature = new char[parameterTypeNames.length][];
  for (int i = 0; i < parameterTypeSignature.length; i++) {
    parameterTypeSignature[i] =
      Signature.createCharArrayTypeSignature(
          CharOperation.concat(
              parameterPackageNames[i],
              CharOperation.replaceOnCopy(parameterTypeNames[i], '.', '$'), '.'), true);
  }
  return Signature.createMethodSignature(
      parameterTypeSignature,
      returnTypeSignature);
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

/**
 * @see IMethod
 */
public String getSignature() throws JavaModelException {
  SourceMethodElementInfo info = (SourceMethodElementInfo) getElementInfo();
  return Signature.createMethodSignature(this.parameterTypes, Signature.createTypeSignature(info.getReturnTypeName(), false));
}
/**

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnTypeSignature) {
  char[][] parameterTypeSignature = new char[parameterTypeNames.length][];
  for (int i = 0; i < parameterTypeSignature.length; i++) {
    parameterTypeSignature[i] =
      Signature.createCharArrayTypeSignature(
          CharOperation.concat(
              parameterPackageNames[i],
              CharOperation.replaceOnCopy(parameterTypeNames[i], '.', '$'), '.'), true);
  }
  return Signature.createMethodSignature(
      parameterTypeSignature,
      returnTypeSignature);
}

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnTypeSignature) {
  char[][] parameterTypeSignature = new char[parameterTypeNames.length][];
  for (int i = 0; i < parameterTypeSignature.length; i++) {
    parameterTypeSignature[i] =
      Signature.createCharArrayTypeSignature(
          CharOperation.concat(
              parameterPackageNames[i],
              CharOperation.replaceOnCopy(parameterTypeNames[i], '.', '$'), '.'), true);
  }
  return Signature.createMethodSignature(
      parameterTypeSignature,
      returnTypeSignature);
}

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

public static char[] createMethodSignature(char[][] parameterPackageNames, char[][] parameterTypeNames, char[] returnTypeSignature) {
  char[][] parameterTypeSignature = new char[parameterTypeNames.length][];
  for (int i = 0; i < parameterTypeSignature.length; i++) {
    parameterTypeSignature[i] =
      Signature.createCharArrayTypeSignature(
          CharOperation.concat(
              parameterPackageNames[i],
              CharOperation.replaceOnCopy(parameterTypeNames[i], '.', '$'), '.'), true);
  }
  return Signature.createMethodSignature(
      parameterTypeSignature,
      returnTypeSignature);
}

代码示例来源:origin: org.eclipse/org.eclipse.jst.jsf.core

public CompositeType getExpectedRuntimeType() throws ELIsNotValidException {
  String[] params = getParams();
  
  // need to "signaturize" each parameter
  for (int param = 0; param < params.length; param++)
  {
    params[param] = Signature.createTypeSignature(params[param],true);
  }
  
  String returnType = Signature.createTypeSignature(getReturnType(), true);
  if (returnType == null)
  {
    return null;
  }
  
  String methodSig = Signature.createMethodSignature(params, returnType);
  return new CompositeType(methodSig, IAssignable.ASSIGNMENT_TYPE_NONE);
}

相关文章