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.GewerbeHalleProduktion.java

public BigDecimal getBodenbelastung() {
    try {// ww w  . j a v  a2 s  .co  m
        return Is24CsvFormat.parseDecimal(this.get(FIELD_BODENBELASTUNG));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Bodenbelastung'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

public BigDecimal getKranbahnTragkraft() {
    try {/* w  w w  .ja  v a  2s.c om*/
        return Is24CsvFormat.parseDecimal(this.get(FIELD_KRANBAHN_TRAGKRAFT));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Kranbahn Tragkraft'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

public Integer getStromanschlusswert() {
    try {/*from  www.ja  v a 2 s . c  om*/
        return Is24CsvFormat.parseInteger(this.get(FIELD_STROMANSCHLUSSWERT));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Stromanschlusswert'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:com.hybris.mobile.app.commerce.adapter.ProductListAdapterBase.java

/**
 * Add to cart/*from   ww  w.java  2 s  .  c o m*/
 *
 * @param code : product code
 * @param qty  : quantity to added
 */
protected void addToCart(String code, String qty, final ProductViewHolder productViewHolder) {
    try {
        //          CartHelperBase.addToCart(getContext(), null, null, code, Integer.parseInt(qty), null, null);
        CartHelperBase.addToCart(getContext(), null, new CartHelperBase.OnAddToCart() {
            //          To Disable add to cart button on list view
            @Override
            public void onAddToCart(CartModification productAdded) {

                productViewHolder.setAddCartButton(!productAdded.isOutOfStock());
            }

            @Override
            public void onAddToCartError(boolean isOutOfStock) {

            }

        }, code, Integer.parseInt(qty), null, null);

    } catch (NumberFormatException e) {
        Log.e(TAG, e.getLocalizedMessage());
    }
}

From source file:org.artemis.toolkit.table.gen.NoMoreDataException.java

public genBoolean(order iorder, int istep, String irange) {
    super(iorder, istep, irange);
    if (mDataRange.getOptionCount() == 1) {
        try {/*w  ww  . j  av a  2  s  . co m*/
            mbooltype = Integer.parseInt(mDataRange.getOption(0));
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    } else {
        mbooltype = 2;
    }
}

From source file:com.kdmanalytics.toif.assimilator.XMLNode.java

/**
 * Using the XMI path string, find the referenced node and return its URI.
 * /*from  ww w  .j  a va  2s. c  o m*/
 * @param token
 * @return
 */
public String getURIByPath(String iPath) {
    // System.err.println(" * " + iPath);
    // Strip the preceding slashes.
    String path = iPath;
    while (path.startsWith("/"))
        path = path.substring(1);

    String token = null;
    int index = path.indexOf("/");
    if (index >= 0) {
        token = path.substring(0, index);
        path = path.substring(index + 1);
    } else {
        token = path;
        path = null;
    }

    index = token.indexOf(".");
    String type = null;
    // form: name.<count>
    if (index >= 0) {
        type = token.substring(0, index);
        String displacement = token.substring(index + 1);
        try {
            // index = Integer.parseInt(displacement);
            index = parseIntChecked(displacement);
        } catch (NumberFormatException ex) {
            LOG.error("Cannot parse fragment from (" + iPath + ")");
            LOG.error(ex.getLocalizedMessage(), ex);
            return null;
        }
    }
    // form: // or /0/
    else {
        if (token.equals("*"))
            index = 0;
        else {
            try {
                index = Integer.parseInt(token);
                LOG.warn("Cannot find node with id/path " + iPath);
            } catch (NumberFormatException ex) {
            }
            index = 0;
        }
    }

    int count = -1;
    for (Iterator<XMLNode> it = children.iterator(); it.hasNext();) {
        XMLNode node = it.next();
        if (type == null)
            count++;
        else if (type.equals("@" + node.getType()))
            count++;
        if (count == index) {
            if (path == null)
                return node.getURIString();
            return node.getURIByPath(path);
        }
    }
    LOG.error("could not get element by URI path " + iPath);
    return null;
}

From source file:org.artemis.toolkit.table.gen.NoMoreDataException.java

public genString(order iorder, int istep, String irange) {
    super(iorder, istep, irange);

    String lOption = mDataRange.getOption(0);
    if (lOption != null && lOption.length() > 0) {
        try {//from w w w  .  j  av  a2s  .  c  om
            mStringLength = Integer.parseInt(lOption);
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    } else {
        lOption = mDataRange.getOption(1);
        if (lOption != null && lOption.length() > 0) {
            try {
                mStringLength = Integer.parseInt(lOption);
            } catch (NumberFormatException e) {
                LOG.warn(e.getLocalizedMessage());
            }
        }
    }
}

From source file:org.artemis.toolkit.table.gen.NoMoreDataException.java

public genShort(order iorder, int istep, String irange) {
    super(iorder, istep, irange);
    String lOption = mDataRange.getOption(0);
    if (lOption != null && lOption.length() > 0) {
        try {//from  w  w w.jav a 2  s  .com
            mLowestValue = Short.parseShort(lOption);
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    }
    lOption = mDataRange.getOption(1);
    if (lOption != null && lOption.length() > 0) {
        try {
            mBoundaryValue = Short.parseShort(lOption);
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    }
    if (mOrder == analyticsops.order.Ascend) {
        mCurrentValue = mLowestValue;
    } else if (mOrder == analyticsops.order.Descend) {
        mCurrentValue = mBoundaryValue;
    }
}

From source file:org.artemis.toolkit.table.gen.NoMoreDataException.java

public genInteger(order iorder, int istep, String irange) {
    super(iorder, istep, irange);
    String lOption = mDataRange.getOption(0);
    if (lOption != null && lOption.length() > 0) {
        try {//from  ww  w . j  a v  a 2  s. co m
            mLowestValue = Integer.parseInt(lOption);
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    }
    lOption = mDataRange.getOption(1);
    if (lOption != null && lOption.length() > 0) {
        try {
            mBoundaryValue = Integer.parseInt(lOption);
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    }
    if (mOrder == analyticsops.order.Ascend) {
        mCurrentValue = mLowestValue;
    } else if (mOrder == analyticsops.order.Descend) {
        mCurrentValue = mBoundaryValue;
    }
}

From source file:org.artemis.toolkit.table.gen.NoMoreDataException.java

public genLong(order iorder, int istep, String irange) {
    super(iorder, istep, irange);
    String lOption = mDataRange.getOption(0);
    if (lOption != null && lOption.length() > 0) {
        try {//from  w w w  . j a  va  2 s .c  o  m
            mLowestValue = Long.parseLong(lOption);
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    }
    lOption = mDataRange.getOption(1);
    if (lOption != null && lOption.length() > 0) {
        try {
            mBoundaryValue = Long.parseLong(lOption);
        } catch (NumberFormatException e) {
            LOG.warn(e.getLocalizedMessage());
        }
    }
    if (mOrder == analyticsops.order.Ascend) {
        mCurrentValue = mLowestValue;
    } else if (mOrder == analyticsops.order.Descend) {
        mCurrentValue = mBoundaryValue;
    }
}