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

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

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

Signature.createTypeParameterSignature介绍

[英]Creates a new type parameter signature with the given name and bounds.
[中]创建具有给定名称和边界的新类型参数签名。

代码示例

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

/**
 * Creates a new type parameter signature with the given name and bounds.
 *
 * @param typeParameterName the type parameter name
 * @param boundSignatures the signatures of associated bounds or empty array if none
 * @return the encoded type parameter signature
 *
 * @since 3.1
 */
public static String createTypeParameterSignature(String typeParameterName, String[] boundSignatures) {
  int length = boundSignatures.length;
  char[][] boundSignatureChars = new char[length][];
  for (int i = 0; i < length; i++) {
    boundSignatureChars[i] = boundSignatures[i].toCharArray();
  }
  return new String(createTypeParameterSignature(typeParameterName.toCharArray(), boundSignatureChars));
}

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

/**
 * Creates a new type parameter signature with the given name and bounds.
 *
 * @param typeParameterName the type parameter name
 * @param boundSignatures the signatures of associated bounds or empty array if none
 * @return the encoded type parameter signature
 *
 * @since 3.1
 */
public static String createTypeParameterSignature(String typeParameterName, String[] boundSignatures) {
  int length = boundSignatures.length;
  char[][] boundSignatureChars = new char[length][];
  for (int i = 0; i < length; i++) {
    boundSignatureChars[i] = boundSignatures[i].toCharArray();
  }
  return new String(createTypeParameterSignature(typeParameterName.toCharArray(), boundSignatureChars));
}

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

/**
 * Creates a new type parameter signature with the given name and bounds.
 *
 * @param typeParameterName the type parameter name
 * @param boundSignatures the signatures of associated bounds or empty array if none
 * @return the encoded type parameter signature
 *
 * @since 3.1
 */
public static String createTypeParameterSignature(String typeParameterName, String[] boundSignatures) {
  int length = boundSignatures.length;
  char[][] boundSignatureChars = new char[length][];
  for (int i = 0; i < length; i++) {
    boundSignatureChars[i] = boundSignatures[i].toCharArray();
  }
  return new String(createTypeParameterSignature(typeParameterName.toCharArray(), boundSignatureChars));
}

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

/**
 * Creates a new type parameter signature with the given name and bounds.
 *
 * @param typeParameterName the type parameter name
 * @param boundSignatures the signatures of associated bounds or empty array if none
 * @return the encoded type parameter signature
 *
 * @since 3.1
 */
public static String createTypeParameterSignature(String typeParameterName, String[] boundSignatures) {
  int length = boundSignatures.length;
  char[][] boundSignatureChars = new char[length][];
  for (int i = 0; i < length; i++) {
    boundSignatureChars[i] = boundSignatures[i].toCharArray();
  }
  return new String(createTypeParameterSignature(typeParameterName.toCharArray(), boundSignatureChars));
}

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

/**
 * Creates a new type parameter signature with the given name and bounds.
 *
 * @param typeParameterName the type parameter name
 * @param boundSignatures the signatures of associated bounds or empty array if none
 * @return the encoded type parameter signature
 *
 * @since 3.1
 */
public static String createTypeParameterSignature(String typeParameterName, String[] boundSignatures) {
  int length = boundSignatures.length;
  char[][] boundSignatureChars = new char[length][];
  for (int i = 0; i < length; i++) {
    boundSignatureChars[i] = boundSignatures[i].toCharArray();
  }
  return new String(createTypeParameterSignature(typeParameterName.toCharArray(), boundSignatureChars));
}

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

/**
 * Creates a new type parameter signature with the given name and bounds.
 *
 * @param typeParameterName the type parameter name
 * @param boundSignatures the signatures of associated bounds or empty array if none
 * @return the encoded type parameter signature
 *
 * @since 3.1
 */
public static String createTypeParameterSignature(String typeParameterName, String[] boundSignatures) {
  int length = boundSignatures.length;
  char[][] boundSignatureChars = new char[length][];
  for (int i = 0; i < length; i++) {
    boundSignatureChars[i] = boundSignatures[i].toCharArray();
  }
  return new String(createTypeParameterSignature(typeParameterName.toCharArray(), boundSignatureChars));
}

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

public void consumeType() {
  // remove main type if needed
  if (this.mainTypeStart != -1) {
    this.signature.replace(this.mainTypeStart, this.mainTypeEnd, ""); //$NON-NLS-1$
  }
  // parameter types
  int length = this.typeParameters.size();
  if (length > 0) {
    StringBuffer typeParametersSig = new StringBuffer();
    typeParametersSig.append('<');
    for (int i = 0; i < length; i++) {
      char[] typeParameterSig = Signature.createTypeParameterSignature(
          (char[]) this.typeParameters.get(i),
          new char[][]{ ConstantPool.ObjectSignature });
      typeParametersSig.append(typeParameterSig);
      // TODO (jerome) add type parameter bounds in binding key
    }
    typeParametersSig.append('>');
    this.signature.insert(this.typeSigStart, typeParametersSig.toString());
    this.typeParameters = new ArrayList();
  }
  this.signature.append(';');
}

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

public void consumeType() {
  // remove main type if needed
  if (this.mainTypeStart != -1) {
    this.signature.replace(this.mainTypeStart, this.mainTypeEnd, ""); //$NON-NLS-1$
  }
  // parameter types
  int length = this.typeParameters.size();
  if (length > 0) {
    StringBuffer typeParametersSig = new StringBuffer();
    typeParametersSig.append('<');
    for (int i = 0; i < length; i++) {
      char[] typeParameterSig = Signature.createTypeParameterSignature(
          (char[]) this.typeParameters.get(i),
          new char[][]{ ConstantPool.ObjectSignature });
      typeParametersSig.append(typeParameterSig);
      // TODO (jerome) add type parameter bounds in binding key
    }
    typeParametersSig.append('>');
    this.signature.insert(this.typeSigStart, typeParametersSig.toString());
    this.typeParameters = new ArrayList();
  }
  this.signature.append(';');
}

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

public void consumeType() {
  // remove main type if needed
  if (this.mainTypeStart != -1) {
    this.signature.replace(this.mainTypeStart, this.mainTypeEnd, ""); //$NON-NLS-1$
  }
  // parameter types
  int length = this.typeParameters.size();
  if (length > 0) {
    StringBuffer typeParametersSig = new StringBuffer();
    typeParametersSig.append('<');
    for (int i = 0; i < length; i++) {
      char[] typeParameterSig = Signature.createTypeParameterSignature(
          (char[]) this.typeParameters.get(i),
          new char[][]{ ConstantPool.ObjectSignature });
      typeParametersSig.append(typeParameterSig);
      // TODO (jerome) add type parameter bounds in binding key
    }
    typeParametersSig.append('>');
    this.signature.insert(this.typeSigStart, typeParametersSig.toString());
    this.typeParameters = new ArrayList();
  }
  this.signature.append(';');
}

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

@Override
public void consumeType() {
  // remove main type if needed
  if (this.mainTypeStart != -1) {
    this.signature.replace(this.mainTypeStart, this.mainTypeEnd, ""); //$NON-NLS-1$
  }
  // parameter types
  int length = this.typeParameters.size();
  if (length > 0) {
    StringBuffer typeParametersSig = new StringBuffer();
    typeParametersSig.append('<');
    for (int i = 0; i < length; i++) {
      char[] typeParameterSig = Signature.createTypeParameterSignature(
          (char[]) this.typeParameters.get(i),
          new char[][]{ ConstantPool.ObjectSignature });
      typeParametersSig.append(typeParameterSig);
      // TODO (jerome) add type parameter bounds in binding key
    }
    typeParametersSig.append('>');
    this.signature.insert(this.typeSigStart, typeParametersSig.toString());
    this.typeParameters = new ArrayList();
  }
  this.signature.append(';');
}

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

public void consumeType() {
  // remove main type if needed
  if (this.mainTypeStart != -1) {
    this.signature.replace(this.mainTypeStart, this.mainTypeEnd, ""); //$NON-NLS-1$
  }
  // parameter types
  int length = this.typeParameters.size();
  if (length > 0) {
    StringBuffer typeParametersSig = new StringBuffer();
    typeParametersSig.append('<');
    for (int i = 0; i < length; i++) {
      char[] typeParameterSig = Signature.createTypeParameterSignature(
          (char[]) this.typeParameters.get(i),
          new char[][]{ ConstantPool.ObjectSignature });
      typeParametersSig.append(typeParameterSig);
      // TODO (jerome) add type parameter bounds in binding key
    }
    typeParametersSig.append('>');
    this.signature.insert(this.typeSigStart, typeParametersSig.toString());
    this.typeParameters = new ArrayList();
  }
  this.signature.append(';');
}

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

public void consumeType() {
  // remove main type if needed
  if (this.mainTypeStart != -1) {
    this.signature.replace(this.mainTypeStart, this.mainTypeEnd, ""); //$NON-NLS-1$
  }
  // parameter types
  int length = this.typeParameters.size();
  if (length > 0) {
    StringBuffer typeParametersSig = new StringBuffer();
    typeParametersSig.append('<');
    for (int i = 0; i < length; i++) {
      char[] typeParameterSig = Signature.createTypeParameterSignature(
          (char[]) this.typeParameters.get(i),
          new char[][]{ ConstantPool.ObjectSignature });
      typeParametersSig.append(typeParameterSig);
      // TODO (jerome) add type parameter bounds in binding key
    }
    typeParametersSig.append('>');
    this.signature.insert(this.typeSigStart, typeParametersSig.toString());
    this.typeParameters = new ArrayList();
  }
  this.signature.append(';');
}

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

public void consumeType() {
  // remove main type if needed
  if (this.mainTypeStart != -1) {
    this.signature.replace(this.mainTypeStart, this.mainTypeEnd, ""); //$NON-NLS-1$
  }
  // parameter types
  int length = this.typeParameters.size();
  if (length > 0) {
    StringBuffer typeParametersSig = new StringBuffer();
    typeParametersSig.append('<');
    for (int i = 0; i < length; i++) {
      char[] typeParameterSig = Signature.createTypeParameterSignature(
          (char[]) this.typeParameters.get(i),
          new char[][]{ ConstantPool.ObjectSignature });
      typeParametersSig.append(typeParameterSig);
      // TODO (jerome) add type parameter bounds in binding key
    }
    typeParametersSig.append('>');
    this.signature.insert(this.typeSigStart, typeParametersSig.toString());
    this.typeParameters = new ArrayList();
  }
  this.signature.append(';');
}

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

/**
 * @see IMethod#getTypeParameterSignatures()
 * @since 3.0
 * @deprecated
 */
@Override
public String[] getTypeParameterSignatures() throws JavaModelException {
  ITypeParameter[] typeParameters = getTypeParameters();
  int length = typeParameters.length;
  String[] typeParameterSignatures = new String[length];
  for (int i = 0; i < length; i++) {
    TypeParameter typeParameter = (TypeParameter) typeParameters[i];
    TypeParameterElementInfo info = (TypeParameterElementInfo) typeParameter.getElementInfo();
    char[][] bounds = info.bounds;
    if (bounds == null) {
      typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameter.getElementName(), CharOperation.NO_STRINGS);
    } else {
      int boundsLength = bounds.length;
      char[][] boundSignatures = new char[boundsLength][];
      for (int j = 0; j < boundsLength; j++) {
        boundSignatures[j] = Signature.createCharArrayTypeSignature(bounds[j], false);
      }
      typeParameterSignatures[i] = new String(Signature.createTypeParameterSignature(typeParameter.getElementName().toCharArray(), boundSignatures));
    }
  }
  return typeParameterSignatures;
}

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

/**
 * @see IType#getTypeParameterSignatures()
 * @since 3.0
 */
public String[] getTypeParameterSignatures() throws JavaModelException {
  ITypeParameter[] typeParameters = getTypeParameters();
  int length = typeParameters.length;
  String[] typeParameterSignatures = new String[length];
  for (int i = 0; i < length; i++) {
    TypeParameter typeParameter = (TypeParameter) typeParameters[i];
    TypeParameterElementInfo info = (TypeParameterElementInfo) typeParameter.getElementInfo();
    char[][] bounds = info.bounds;
    if (bounds == null) {
      typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameter.getElementName(), CharOperation.NO_STRINGS);
    } else {
      int boundsLength = bounds.length;
      char[][] boundSignatures = new char[boundsLength][];
      for (int j = 0; j < boundsLength; j++) {
        boundSignatures[j] = Signature.createCharArrayTypeSignature(bounds[j], false);
      }
      typeParameterSignatures[i] = new String(Signature.createTypeParameterSignature(typeParameter.getElementName().toCharArray(), boundSignatures));
    }
  }
  return typeParameterSignatures;
}

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

/**
 * @see IMethod#getTypeParameterSignatures()
 * @since 3.0
 * @deprecated
 */
public String[] getTypeParameterSignatures() throws JavaModelException {
  ITypeParameter[] typeParameters = getTypeParameters();
  int length = typeParameters.length;
  String[] typeParameterSignatures = new String[length];
  for (int i = 0; i < length; i++) {
    TypeParameter typeParameter = (TypeParameter) typeParameters[i];
    TypeParameterElementInfo info = (TypeParameterElementInfo) typeParameter.getElementInfo();
    char[][] bounds = info.bounds;
    if (bounds == null) {
      typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameter.getElementName(), CharOperation.NO_STRINGS);
    } else {
      int boundsLength = bounds.length;
      char[][] boundSignatures = new char[boundsLength][];
      for (int j = 0; j < boundsLength; j++) {
        boundSignatures[j] = Signature.createCharArrayTypeSignature(bounds[j], false);
      }
      typeParameterSignatures[i] = new String(Signature.createTypeParameterSignature(typeParameter.getElementName().toCharArray(), boundSignatures));
    }
  }
  return typeParameterSignatures;
}

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

private void enterInterface(TypeInfo typeInfo) {
  // eliminate possible qualifications, given they need to be fully resolved again
  if (typeInfo.superinterfaces != null){
    for (int i = 0, length = typeInfo.superinterfaces.length; i < length; i++){
      typeInfo.superinterfaces[i] = getSimpleName(typeInfo.superinterfaces[i]);
    }
  }
  char[][] typeNames;
  if (this.methodDepth > 0) {
    typeNames = ONE_ZERO_CHAR;
  } else {
    typeNames = enclosingTypeNames();
  }
  char[][] typeParameterSignatures = null;
  if (typeInfo.typeParameters != null) {
    int typeParametersLength = typeInfo.typeParameters.length;
    typeParameterSignatures = new char[typeParametersLength][];
    for (int i = 0; i < typeParametersLength; i++) {
      ISourceElementRequestor.TypeParameterInfo typeParameterInfo = typeInfo.typeParameters[i];
      typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameterInfo.name, typeParameterInfo.bounds);
    }
  }
  this.indexer.addInterfaceDeclaration(typeInfo.modifiers, this.packageName, typeInfo.name, typeNames, typeInfo.superinterfaces, typeParameterSignatures, typeInfo.secondary);
  addDefaultConstructorIfNecessary(typeInfo);
  pushTypeName(typeInfo.name);
}

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

private void enterInterface(TypeInfo typeInfo) {
  // eliminate possible qualifications, given they need to be fully resolved again
  if (typeInfo.superinterfaces != null){
    for (int i = 0, length = typeInfo.superinterfaces.length; i < length; i++){
      typeInfo.superinterfaces[i] = getSimpleName(typeInfo.superinterfaces[i]);
    }
  }
  char[][] typeNames;
  if (this.methodDepth > 0) {
    typeNames = ONE_ZERO_CHAR;
  } else {
    typeNames = enclosingTypeNames();
  }
  char[][] typeParameterSignatures = null;
  if (typeInfo.typeParameters != null) {
    int typeParametersLength = typeInfo.typeParameters.length;
    typeParameterSignatures = new char[typeParametersLength][];
    for (int i = 0; i < typeParametersLength; i++) {
      ISourceElementRequestor.TypeParameterInfo typeParameterInfo = typeInfo.typeParameters[i];
      typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameterInfo.name, typeParameterInfo.bounds);
    }
  }
  this.indexer.addInterfaceDeclaration(typeInfo.modifiers, this.packageName, typeInfo.name, typeNames, typeInfo.superinterfaces, typeParameterSignatures, typeInfo.secondary);
  addDefaultConstructorIfNecessary(typeInfo);
  pushTypeName(typeInfo.name);
}

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

private void enterInterface(TypeInfo typeInfo) {
  // eliminate possible qualifications, given they need to be fully resolved again
  if (typeInfo.superinterfaces != null){
    for (int i = 0, length = typeInfo.superinterfaces.length; i < length; i++){
      typeInfo.superinterfaces[i] = getSimpleName(typeInfo.superinterfaces[i]);
    }
  }
  char[][] typeNames;
  if (this.methodDepth > 0) {
    typeNames = ONE_ZERO_CHAR;
  } else {
    typeNames = enclosingTypeNames();
  }
  char[][] typeParameterSignatures = null;
  if (typeInfo.typeParameters != null) {
    int typeParametersLength = typeInfo.typeParameters.length;
    typeParameterSignatures = new char[typeParametersLength][];
    for (int i = 0; i < typeParametersLength; i++) {
      ISourceElementRequestor.TypeParameterInfo typeParameterInfo = typeInfo.typeParameters[i];
      typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameterInfo.name, typeParameterInfo.bounds);
    }
  }
  this.indexer.addInterfaceDeclaration(typeInfo.modifiers, this.packageName, typeInfo.name, typeNames, typeInfo.superinterfaces, typeParameterSignatures, typeInfo.secondary);
  addDefaultConstructorIfNecessary(typeInfo);
  pushTypeName(typeInfo.name);
}
/**

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

private void enterInterface(TypeInfo typeInfo) {
  // eliminate possible qualifications, given they need to be fully resolved again
  if (typeInfo.superinterfaces != null){
    for (int i = 0, length = typeInfo.superinterfaces.length; i < length; i++){
      typeInfo.superinterfaces[i] = getSimpleName(typeInfo.superinterfaces[i]);
    }
  }
  char[][] typeNames;
  if (this.methodDepth > 0) {
    typeNames = ONE_ZERO_CHAR;
  } else {
    typeNames = enclosingTypeNames();
  }
  char[][] typeParameterSignatures = null;
  if (typeInfo.typeParameters != null) {
    int typeParametersLength = typeInfo.typeParameters.length;
    typeParameterSignatures = new char[typeParametersLength][];
    for (int i = 0; i < typeParametersLength; i++) {
      ISourceElementRequestor.TypeParameterInfo typeParameterInfo = typeInfo.typeParameters[i];
      typeParameterSignatures[i] = Signature.createTypeParameterSignature(typeParameterInfo.name, typeParameterInfo.bounds);
    }
  }
  this.indexer.addInterfaceDeclaration(typeInfo.modifiers, this.packageName, typeInfo.name, typeNames, typeInfo.superinterfaces, typeParameterSignatures, typeInfo.secondary);
  addDefaultConstructorIfNecessary(typeInfo);
  pushTypeName(typeInfo.name);
}
/**

相关文章