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

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

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

Signature.getThrownExceptionTypes介绍

[英]Extracts the thrown exception type signatures from the given method signature if any The method signature is expected to be dot-based.
[中]如果方法签名预期是基于点的,则从给定的方法签名中提取抛出的异常类型签名。

代码示例

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

/**
 * Extracts the thrown exception type signatures from the given method signature if any
 * The method signature is expected to be dot-based.
 *
 * @param methodSignature the method signature
 * @return the list of thrown exception type signatures
 * @exception IllegalArgumentException if the signature is syntactically
 *   incorrect
 *
 * @since 3.1
 */
public static String[] getThrownExceptionTypes(String methodSignature) throws IllegalArgumentException {
  char[][] parameterTypes = getThrownExceptionTypes(methodSignature.toCharArray());
  return CharOperation.toStrings(parameterTypes);
}

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

/**
 * Extracts the thrown exception type signatures from the given method signature if any
 * The method signature is expected to be dot-based.
 *
 * @param methodSignature the method signature
 * @return the list of thrown exception type signatures
 * @exception IllegalArgumentException if the signature is syntactically
 *   incorrect
 *
 * @since 3.1
 */
public static String[] getThrownExceptionTypes(String methodSignature) throws IllegalArgumentException {
  char[][] parameterTypes = getThrownExceptionTypes(methodSignature.toCharArray());
  return CharOperation.toStrings(parameterTypes);
}
/**

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

/**
 * Extracts the thrown exception type signatures from the given method signature if any
 * The method signature is expected to be dot-based.
 *
 * @param methodSignature the method signature
 * @return the list of thrown exception type signatures
 * @exception IllegalArgumentException if the signature is syntactically
 *   incorrect
 *
 * @since 3.1
 */
public static String[] getThrownExceptionTypes(String methodSignature) throws IllegalArgumentException {
  char[][] parameterTypes = getThrownExceptionTypes(methodSignature.toCharArray());
  return CharOperation.toStrings(parameterTypes);
}
/**

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

/**
 * Extracts the thrown exception type signatures from the given method signature if any
 * The method signature is expected to be dot-based.
 *
 * @param methodSignature the method signature
 * @return the list of thrown exception type signatures
 * @exception IllegalArgumentException if the signature is syntactically
 *   incorrect
 *
 * @since 3.1
 */
public static String[] getThrownExceptionTypes(String methodSignature) throws IllegalArgumentException {
  char[][] parameterTypes = getThrownExceptionTypes(methodSignature.toCharArray());
  return CharOperation.toStrings(parameterTypes);
}
/**

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

/**
 * Extracts the thrown exception type signatures from the given method signature if any
 * The method signature is expected to be dot-based.
 *
 * @param methodSignature the method signature
 * @return the list of thrown exception type signatures
 * @exception IllegalArgumentException if the signature is syntactically
 *   incorrect
 *
 * @since 3.1
 */
public static String[] getThrownExceptionTypes(String methodSignature) throws IllegalArgumentException {
  char[][] parameterTypes = getThrownExceptionTypes(methodSignature.toCharArray());
  return CharOperation.toStrings(parameterTypes);
}
/**

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

/**
 * Extracts the thrown exception type signatures from the given method signature if any
 * The method signature is expected to be dot-based.
 *
 * @param methodSignature the method signature
 * @return the list of thrown exception type signatures
 * @exception IllegalArgumentException if the signature is syntactically
 *   incorrect
 *
 * @since 3.1
 */
public static String[] getThrownExceptionTypes(String methodSignature) throws IllegalArgumentException {
  char[][] parameterTypes = getThrownExceptionTypes(methodSignature.toCharArray());
  return CharOperation.toStrings(parameterTypes);
}
/**

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

public void consumeMethod(char[] selector, char[] methodSignature) {
  this.arguments = new ArrayList();
  this.typeArguments = new ArrayList();
  if (!this.asBinarySignature)
    CharOperation.replace(methodSignature, '/', '.');
  switch(this.kind) {
    case SIGNATURE:
      this.signature = new StringBuffer();
      this.signature.append(methodSignature);
      break;
    case THROWN_EXCEPTIONS:
      if (CharOperation.indexOf('^', methodSignature) > 0) {
        char[][] types = Signature.getThrownExceptionTypes(methodSignature);
        int length = types.length;
        for (int i=0; i<length; i++) {
          this.thrownExceptions.add(new String(types[i]));
        }
      }
      break;
  }
}

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

public void consumeMethod(char[] selector, char[] methodSignature) {
  this.arguments = new ArrayList();
  this.typeArguments = new ArrayList();
  CharOperation.replace(methodSignature, '/', '.');
  switch(this.kind) {
    case SIGNATURE:
      this.signature = new StringBuffer();
      this.signature.append(methodSignature);
      break;
    case THROWN_EXCEPTIONS:
      if (CharOperation.indexOf('^', methodSignature) > 0) {
        char[][] types = Signature.getThrownExceptionTypes(methodSignature);
        int length = types.length;
        for (int i=0; i<length; i++) {
          this.thrownExceptions.add(new String(types[i]));
        }
      }
      break;
  }
}

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

public void consumeMethod(char[] selector, char[] methodSignature) {
  this.arguments = new ArrayList();
  this.typeArguments = new ArrayList();
  CharOperation.replace(methodSignature, '/', '.');
  switch(this.kind) {
    case SIGNATURE:
      this.signature = new StringBuffer();
      this.signature.append(methodSignature);
      break;
    case THROWN_EXCEPTIONS:
      if (CharOperation.indexOf('^', methodSignature) > 0) {
        char[][] types = Signature.getThrownExceptionTypes(methodSignature);
        int length = types.length;
        for (int i=0; i<length; i++) {
          this.thrownExceptions.add(new String(types[i]));
        }
      }
      break;
  }
}

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

public void consumeMethod(char[] selector, char[] methodSignature) {
  this.arguments = new ArrayList();
  this.typeArguments = new ArrayList();
  CharOperation.replace(methodSignature, '/', '.');
  switch(this.kind) {
    case SIGNATURE:
      this.signature = new StringBuffer();
      this.signature.append(methodSignature);
      break;
    case THROWN_EXCEPTIONS:
      if (CharOperation.indexOf('^', methodSignature) > 0) {
        char[][] types = Signature.getThrownExceptionTypes(methodSignature);
        int length = types.length;
        for (int i=0; i<length; i++) {
          this.thrownExceptions.add(new String(types[i]));
        }
      }
      break;
  }
}

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

public void consumeMethod(char[] selector, char[] methodSignature) {
  this.arguments = new ArrayList();
  this.typeArguments = new ArrayList();
  CharOperation.replace(methodSignature, '/', '.');
  switch(this.kind) {
    case SIGNATURE:
      this.signature = new StringBuffer();
      this.signature.append(methodSignature);
      break;
    case THROWN_EXCEPTIONS:
      if (CharOperation.indexOf('^', methodSignature) > 0) {
        char[][] types = Signature.getThrownExceptionTypes(methodSignature);
        int length = types.length;
        for (int i=0; i<length; i++) {
          this.thrownExceptions.add(new String(types[i]));
        }
      }
      break;
  }
}

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

@Override
public void consumeMethod(char[] selector, char[] methodSignature) {
  this.arguments = new ArrayList();
  this.typeArguments = new ArrayList();
  if (!this.asBinarySignature)
    CharOperation.replace(methodSignature, '/', '.');
  switch(this.kind) {
    case SIGNATURE:
      this.signature = new StringBuffer();
      this.signature.append(methodSignature);
      break;
    case THROWN_EXCEPTIONS:
      if (CharOperation.indexOf('^', methodSignature) > 0) {
        char[][] types = Signature.getThrownExceptionTypes(methodSignature);
        int length = types.length;
        for (int i=0; i<length; i++) {
          this.thrownExceptions.add(new String(types[i]));
        }
      }
      break;
  }
}

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

public void consumeMethod(char[] selector, char[] methodSignature) {
  this.arguments = new ArrayList();
  this.typeArguments = new ArrayList();
  if (!this.asBinarySignature)
    CharOperation.replace(methodSignature, '/', '.');
  switch(this.kind) {
    case SIGNATURE:
      this.signature = new StringBuffer();
      this.signature.append(methodSignature);
      break;
    case THROWN_EXCEPTIONS:
      if (CharOperation.indexOf('^', methodSignature) > 0) {
        char[][] types = Signature.getThrownExceptionTypes(methodSignature);
        int length = types.length;
        for (int i=0; i<length; i++) {
          this.thrownExceptions.add(new String(types[i]));
        }
      }
      break;
  }
}

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

public String[] getExceptionTypes() throws JavaModelException {
  if (this.exceptionTypes == null) {
    IBinaryMethod info = (IBinaryMethod) getElementInfo();
    char[] genericSignature = info.getGenericSignature();
    if (genericSignature != null) {
      char[] dotBasedSignature = CharOperation.replaceOnCopy(genericSignature, '/', '.');
      this.exceptionTypes = Signature.getThrownExceptionTypes(new String(dotBasedSignature));
    }
    if (this.exceptionTypes == null || this.exceptionTypes.length == 0) {
      char[][] eTypeNames = info.getExceptionTypeNames();
      if (eTypeNames == null || eTypeNames.length == 0) {
        this.exceptionTypes = CharOperation.NO_STRINGS;
      } else {
        eTypeNames = ClassFile.translatedNames(eTypeNames);
        this.exceptionTypes = new String[eTypeNames.length];
        for (int j = 0, length = eTypeNames.length; j < length; j++) {
          // 1G01HRY: ITPJCORE:WINNT - method.getExceptionType not in correct format
          int nameLength = eTypeNames[j].length;
          char[] convertedName = new char[nameLength + 2];
          System.arraycopy(eTypeNames[j], 0, convertedName, 1, nameLength);
          convertedName[0] = 'L';
          convertedName[nameLength + 1] = ';';
          this.exceptionTypes[j] = new String(convertedName);
        }
      }
    }
  }
  return this.exceptionTypes;
}
/*

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

if (genericSignature != null) {
  char[] dotBasedSignature = CharOperation.replaceOnCopy(genericSignature, '/', '.');
  this.exceptionTypes = Signature.getThrownExceptionTypes(new String(dotBasedSignature));

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

public String[] getExceptionTypes() throws JavaModelException {
  if (this.exceptionTypes == null) {
    IBinaryMethod info = (IBinaryMethod) getElementInfo();
    char[] genericSignature = info.getGenericSignature();
    if (genericSignature != null) {
      char[] dotBasedSignature = CharOperation.replaceOnCopy(genericSignature, '/', '.');
      this.exceptionTypes = Signature.getThrownExceptionTypes(new String(dotBasedSignature));
    }
    if (this.exceptionTypes == null || this.exceptionTypes.length == 0) {
      char[][] eTypeNames = info.getExceptionTypeNames();
      if (eTypeNames == null || eTypeNames.length == 0) {
        this.exceptionTypes = CharOperation.NO_STRINGS;
      } else {
        eTypeNames = ClassFile.translatedNames(eTypeNames);
        this.exceptionTypes = new String[eTypeNames.length];
        for (int j = 0, length = eTypeNames.length; j < length; j++) {
          // 1G01HRY: ITPJCORE:WINNT - method.getExceptionType not in correct format
          int nameLength = eTypeNames[j].length;
          char[] convertedName = new char[nameLength + 2];
          System.arraycopy(eTypeNames[j], 0, convertedName, 1, nameLength);
          convertedName[0] = 'L';
          convertedName[nameLength + 1] = ';';
          this.exceptionTypes[j] = new String(convertedName);
        }
      }
    }
  }
  return this.exceptionTypes;
}
/*

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

public String[] getExceptionTypes() throws JavaModelException {
  if (this.exceptionTypes == null) {
    IBinaryMethod info = (IBinaryMethod) getElementInfo();
    char[] genericSignature = info.getGenericSignature();
    if (genericSignature != null) {
      char[] dotBasedSignature = CharOperation.replaceOnCopy(genericSignature, '/', '.');
      this.exceptionTypes = Signature.getThrownExceptionTypes(new String(dotBasedSignature));
    }
    if (this.exceptionTypes == null || this.exceptionTypes.length == 0) {
      char[][] eTypeNames = info.getExceptionTypeNames();
      if (eTypeNames == null || eTypeNames.length == 0) {
        this.exceptionTypes = CharOperation.NO_STRINGS;
      } else {
        eTypeNames = ClassFile.translatedNames(eTypeNames);
        this.exceptionTypes = new String[eTypeNames.length];
        for (int j = 0, length = eTypeNames.length; j < length; j++) {
          // 1G01HRY: ITPJCORE:WINNT - method.getExceptionType not in correct format
          int nameLength = eTypeNames[j].length;
          char[] convertedName = new char[nameLength + 2];
          System.arraycopy(eTypeNames[j], 0, convertedName, 1, nameLength);
          convertedName[0] = 'L';
          convertedName[nameLength + 1] = ';';
          this.exceptionTypes[j] = new String(convertedName);
        }
      }
    }
  }
  return this.exceptionTypes;
}
/*

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

char[][] exceptions = Signature.getThrownExceptionTypes(methodSignature);
for (int i = 0, exceptionsLength = exceptions.length; i < exceptionsLength; i++) {
  this.signature.append(Signature.C_EXCEPTION_START);

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

char[][] exceptions = Signature.getThrownExceptionTypes(methodSignature);
for (int i = 0, exceptionsLength = exceptions.length; i < exceptionsLength; i++) {
  this.signature.append(Signature.C_EXCEPTION_START);

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

char[][] exceptions = Signature.getThrownExceptionTypes(methodSignature);
for (int i = 0, exceptionsLength = exceptions.length; i < exceptionsLength; i++) {
  this.signature.append(Signature.C_EXCEPTION_START);

相关文章