java.lang.NumberFormatException.getLocalizedMessage()方法的使用及代码示例

x33g5p2x  于2022-01-24 转载在 其他  
字(6.9k)|赞(0)|评价(0)|浏览(93)

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

NumberFormatException.getLocalizedMessage介绍

暂无

代码示例

代码示例来源:origin: pentaho/pentaho-kettle

private Integer parseIntWithSubstitute( String toParse ) {
 toParse = environmentSubstitute( toParse );
 if ( !StringUtils.isEmpty( toParse ) ) {
  try {
   return Integer.parseInt( toParse );
  } catch ( NumberFormatException e ) {
   log.logError( e.getLocalizedMessage() );
  }
 }
 return null;
}

代码示例来源:origin: org.netbeans.api/org-openide-util

magic[(i / 2) - 1] = (byte) Integer.parseInt(g, 16);
} catch (NumberFormatException ex) {
  throw new IOException(ex.getLocalizedMessage());

代码示例来源:origin: oracle/opengrok

throw new IOException(
      String.format("Unsupported type conversion from String to a number for name \"%s\" - %s.",
          fieldName, ex.getLocalizedMessage()), ex);
} catch (IndexOutOfBoundsException ex) {
  throw new IOException(

代码示例来源:origin: caoxinyu/RedisClient

private void okSelected(TableItem[] items,
    String key, Map<String, Double> values) {
  for (TableItem item : items) {
    if(item.getText(0).length() == 0 && item.getText(1).length() > 0)
      throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + item.getText(1));
    if((item.getText(0).length() > 0))
      try{
        values.put(item.getText(1),	Double.valueOf(item.getText(0)));
      }catch(NumberFormatException e){
        throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + e.getLocalizedMessage());
      }
  }
  setResult(new ZSetInfo(key, values, dataContent.getTTL()));
  shell.dispose();
}

代码示例来源:origin: caoxinyu/RedisClient

private void add() {
  Map<String, Double> mapValues = new HashMap<String, Double>();
  
  TableItem item = table.getItem(0);
  if(item.getText(0).length() == 0 && item.getText(1).length() > 0)
    throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + item.getText(1));
  String member;
  
  try{
    member = item.getText(1);
    mapValues.put(member,    Double.valueOf(item.getText(0)));
  }catch(NumberFormatException e1){
    throw new RuntimeException(RedisClient.i18nFile.getText(I18nFile.SCOREERROR) + e1.getLocalizedMessage());
  }
  service.addValues(id, db, key, mapValues);
  refresh();
  gotoMember(member);
  status = Status.Normal;
  statusChanged();
}
private void gotoMember(String member){

代码示例来源:origin: Alluxio/alluxio

response.setFileInfos(fileInfos);
} catch (NumberFormatException e) {
 response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage());
 return response;
} catch (ArithmeticException e) {

代码示例来源:origin: Alluxio/alluxio

response.setFileInfos(fileInfos);
} catch (NumberFormatException e) {
 response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage());
 return response;
} catch (ArithmeticException e) {

代码示例来源:origin: Alluxio/alluxio

response.setFileInfos(fileInfos);
} catch (NumberFormatException e) {
 response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage());
 return response;
} catch (ArithmeticException e) {

代码示例来源:origin: Alluxio/alluxio

response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage());
} catch (ArithmeticException e) {
 response.setFatalError(

代码示例来源:origin: Alluxio/alluxio

response.setFileInfos(fileInfos);
} catch (NumberFormatException e) {
 response.setFatalError("Error: offset or limit parse error, " + e.getLocalizedMessage());
 return response;
} catch (ArithmeticException e) {

代码示例来源:origin: geotools/geotools

/**
 * Getting a specified geotiff geo key as a int. It is somehow tolerant in the sense that in
 * case such a key does not exist it retrieves 0.
 *
 * @param key we want to get the value for.
 * @param metadata containing the key we are looking for.
 * @return
 */
private static int getGeoKeyAsInt(final int key, final GeoTiffIIOMetadataDecoder metadata) {
  try {
    return Integer.parseInt(metadata.getGeoKey(key));
  } catch (NumberFormatException ne) {
    if (LOGGER.isLoggable(Level.FINE)) LOGGER.log(Level.FINE, ne.getLocalizedMessage(), ne);
    return GeoTiffConstants.UNDEFINED;
  }
}

代码示例来源:origin: geotools/geotools

Double getResolution() {
  // get the the match and convert it to double
  String resolutionStr = getMatches().size() > 0 ? getMatches().get(0) : null;
  if (resolutionStr != null) {
    try {
      return Double.parseDouble(resolutionStr);
    } catch (NumberFormatException e) {
      if (LOGGER.isLoggable(Level.FINE)) {
        LOGGER.log(Level.FINE, e.getLocalizedMessage(), e);
      }
    }
  }
  return null;
}

代码示例来源:origin: geotools/geotools

/**
 * Getting a specified geotiff geo key as a double. It is somehow tolerant in the sense that in
 * case such a key does not exist it returns <code>Double.NaN</code>.
 *
 * @param key we want to get the value for.
 * @param metadata containing the key we are looking for.
 * @return the value for the provided key.
 * @throws IOException
 */
private static double getGeoKeyAsDouble(
    final int key, final GeoTiffIIOMetadataDecoder metadata) {
  try {
    final String geoKey = metadata.getGeoKey(key);
    if (geoKey != null) return Double.parseDouble(geoKey);
    else return Double.NaN;
  } catch (NumberFormatException ne) {
    if (LOGGER.isLoggable(Level.WARNING))
      LOGGER.log(Level.WARNING, ne.getLocalizedMessage(), ne);
    return Double.NaN;
  } catch (Exception e) {
    LOGGER.log(Level.WARNING, e.getLocalizedMessage(), e);
    return Double.NaN;
  }
}

代码示例来源:origin: geotools/geotools

+ DEFAULT_EPSG_CODE
+ " due to : "
+ nfe.getLocalizedMessage());

代码示例来源:origin: geotools/geotools

} catch (NumberFormatException nfe) {
  final IOException ioe =
      new GeoTiffException(metadata, nfe.getLocalizedMessage(), nfe);
  throw ioe;

代码示例来源:origin: OpenNMS/opennms

private static int computeIntValue(String parmContent) throws IllegalArgumentException {
  int val = 0;
  try {
    val = Integer.parseInt(parmContent);
  } catch (NumberFormatException e) {
    LOG.error("computeIntValue: parm value passed in the event isn't a valid number." ,e);
    throw new IllegalArgumentException(e.getLocalizedMessage());
  }
  return val;
}

代码示例来源:origin: iipc/openwayback

public void apply(String field, CaptureSearchResult result)
throws CDXFormatException {
  if (field.equals("-")) {
    return;
  }
  
  try {
    result.setCompressedLength(Long.parseLong(field));
  } catch(NumberFormatException e) {
    throw new CDXFormatException(e.getLocalizedMessage());
  }
}

代码示例来源:origin: org.openestate.io/OpenEstate-IO-IS24-CSV

@SuppressWarnings("Duplicates")
public Integer getFahrtwegFlughafen() {
  try {
    return Is24CsvFormat.parseInteger(
        this.get(FIELD_FAHRTWEG_FLUGHAFEN));
  } catch (NumberFormatException ex) {
    LOGGER.warn("Can't read 'Fahrtweg zum Flughafen'!");
    LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
    return null;
  }
}

代码示例来源:origin: org.openestate.io/OpenEstate-IO-IS24-CSV

@SuppressWarnings("Duplicates")
public BigDecimal getKaufpreis() {
  try {
    return Is24CsvFormat.parseDecimal(
        this.get(FIELD_KAUFPREIS));
  } catch (NumberFormatException ex) {
    LOGGER.warn("Can't read 'Kaufpreis'!");
    LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
    return null;
  }
}

代码示例来源:origin: int.esa.ccsds.mo/ENCODING_STRING

@Override
public BigInteger getBigInteger() throws MALException
{
 try
 {
  return new BigInteger(removeFirst());
 }
 catch (NumberFormatException ex)
 {
  throw new MALException(ex.getLocalizedMessage(), ex);
 }
}

相关文章