Example usage for java.lang NumberFormatException getLocalizedMessage

List of usage examples for java.lang NumberFormatException getLocalizedMessage

Introduction

In this page you can find the example usage for java.lang NumberFormatException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:org.openestate.io.is24_csv.records.StellplatzKauf.java

public BigDecimal getBreite() {
    try {/*from ww w .ja  v  a2 s.c  o m*/
        return Is24CsvFormat.parseDecimal(this.get(FIELD_BREITE));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Breite'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:org.openestate.io.is24_csv.records.StellplatzKauf.java

public BigDecimal getLaenge() {
    try {//from   ww w .j a  v  a 2s .c  o m
        return Is24CsvFormat.parseDecimal(this.get(FIELD_LAENGE));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Laenge'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:org.openestate.io.is24_csv.records.StellplatzKauf.java

public BigDecimal getFlaeche() {
    try {/*from ww  w . j  a va 2 s  .co  m*/
        return Is24CsvFormat.parseDecimal(this.get(FIELD_FLAECHE));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Flaeche'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:org.openestate.io.is24_csv.records.StellplatzMiete.java

public BigDecimal getMiete() {
    try {/* ww  w .ja  va  2 s.  c o m*/
        return Is24CsvFormat.parseDecimal(this.get(FIELD_MIETE));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Miete'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:com.bce.gis.io.zweidm.SmsParser.java

private void parse(final Reader reader) throws IOException {
    Assert.isNotNull(reader);/*from   w w w. j a v a 2s . c om*/

    final LineNumberReader lnReader = new LineNumberReader(reader);
    for (String line = lnReader.readLine(); line != null; line = lnReader.readLine()) {
        try {
            if (line.startsWith("ND")) //$NON-NLS-1$
                interpreteNodeLine(line, lnReader);
            else if (line.startsWith("E3T")) //$NON-NLS-1$
                interpreteE3TLine(line, lnReader);
            else if (line.startsWith("E4Q")) //$NON-NLS-1$
                interpreteE4QLine(line, lnReader);
        } catch (final NumberFormatException e) {
            addStatus(lnReader, IStatus.ERROR, Messages.getString("SmsParser_2"), e.getLocalizedMessage()); //$NON-NLS-1$
        }

        /* Abort after too many problems, */
        final int maxProblemCount = 100;
        if (m_stati.size() > maxProblemCount) {
            m_stati.add(IStatus.ERROR, Messages.getString("SmsParser_3")); //$NON-NLS-1$
            return;
        }
    }
}

From source file:org.kalypso.model.wspm.tuhh.ui.imports.WProfMarkerOptions.java

private IMessageProvider doSetText(final String label, final String currentText, final String markerType,
        final boolean isOptional) {
    try {//from   w  w w  .  j  a va 2 s  .  c  om
        final int[] values = parseIntList(currentText);

        /* Set dialog settings, if parsing was successful */
        final IDialogSettings dialogSettings = m_page.getWizard().getDialogSettings();
        if (dialogSettings != null) {
            dialogSettings.put(markerType, currentText);
        }

        if (values.length == 0) {
            if (!isOptional)
                return new MessageProvider(String.format(Messages.getString("WProfMarkerOptions_4"), label), //$NON-NLS-1$
                        IMessageProvider.ERROR);

            return null;
        }

        m_markerMap.put(markerType, values);
        return null;
    } catch (final NumberFormatException e) {
        return new MessageProvider(
                String.format(Messages.getString("WProfMarkerOptions_5"), currentText, e.getLocalizedMessage()), //$NON-NLS-1$
                IMessageProvider.ERROR);
    }
}

From source file:org.openestate.io.is24_csv.records.GrundstueckGewerbe.java

public Integer getErbpachtdauer() {
    try {/*w w  w . j  a v a  2 s .com*/
        return Is24CsvFormat.parseInteger(this.get(FIELD_ERBPACHTDAUER));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Erbpachtdauer'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:org.openestate.io.is24_csv.records.GrundstueckGewerbe.java

public BigDecimal getGrundflaechenzahl() {
    try {/*from  ww  w.  j  a  v a 2 s  .  c o  m*/
        return Is24CsvFormat.parseDecimal(this.get(FIELD_GRUNDFLAECHENZAHL));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Grundflaechenzahl'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:org.apache.jmeter.config.RandomVariableConfig.java

/**
 * @return the randomSeed as a long// ww w.  j av a2  s  .c  o m
 */
private synchronized long getRandomSeedAsLong() {
    long seed = 0;
    if (randomSeed.length() == 0) {
        seed = System.currentTimeMillis();
    } else {
        try {
            seed = Long.parseLong(randomSeed);
        } catch (NumberFormatException e) {
            seed = System.currentTimeMillis();
            log.warn("Cannot parse seed " + e.getLocalizedMessage());
        }
    }
    return seed;
}

From source file:org.openestate.io.is24_csv.records.GrundstueckGewerbe.java

public Long getFlaecheTeilbarAb() {
    try {/*www  .java2s .  c  o m*/
        return Is24CsvFormat.parseLong(this.get(FIELD_FLAECHE_TEILBAR_AB));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Flaeche teilbar ab'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}