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

public Integer getAnzahlGastraumplaetze() {
    try {//from w ww  .  j  a va2s .  c  o m
        return Is24CsvFormat.parseInteger(this.get(FIELD_ANZAHL_GASTRAUMPLAETZE));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Anzahl Gastraumplaetze'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

public BigDecimal getMieteinnahmenProMonat() {
    try {//  w  ww .ja va2s  .  c  o m
        return Is24CsvFormat.parseDecimal(this.get(FIELD_MIETEINNAHMEN_PRO_MONAT));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Mieteinnahmen pro Monat'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

public Integer getAnzahlGarageStellplatz() {
    try {/*  w w  w.j  a v a  2 s .  c om*/
        return Is24CsvFormat.parseInteger(this.get(FIELD_ANZAHL_GARAGE_STELLPLATZ));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Anzahl Garage / Stellplatz'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

From source file:org.opencms.workplace.CmsTabDialog.java

/**
 * Returns the number of the currently active tab depending on the request parameter.<p>
 * //  ww w  .j  av  a2 s.com
 * This method has to be called once in initWorkplaceRequestValues after filling the request parameters.<p>
 * 
 * @return the number of the currently active tab
 */
public int getActiveTab() {

    if (m_activeTab < 0) {
        String paramTab = getParamTab();
        int tab = 1;
        if (CmsStringUtil.isNotEmpty(paramTab)) {
            try {
                tab = Integer.parseInt(paramTab);
            } catch (NumberFormatException e) {
                // do nothing, the first tab is returned
                if (LOG.isInfoEnabled()) {
                    LOG.info(e.getLocalizedMessage());
                }
            }
        }
        setParamTab("" + tab);
        m_activeTab = tab;
        return tab;
    } else {
        return m_activeTab;
    }
}

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

public BigDecimal getWarmmiete() {
    try {//w  w  w .  j av a2  s .com
        return Is24CsvFormat.parseDecimal(this.get(FIELD_WARMMIETE));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Warmmiete'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

@Override
public View getView(final int position, View convertView, ViewGroup parent) {

    View rowView;//w  w  w  . ja v  a  2  s . c  o  m
    final OrderEntry orderEntry = mProducts.get(position);

    if (convertView == null) {
        LayoutInflater inflater = (LayoutInflater) getContext()
                .getSystemService(Context.LAYOUT_INFLATER_SERVICE);
        rowView = inflater.inflate(R.layout.item_cart_product, parent, false);

        rowView.setTag(new CartViewHolder(rowView, position));
    } else {
        rowView = convertView;
    }

    final CartViewHolder cartViewHolder = (CartViewHolder) rowView.getTag();

    if (orderEntry != null) {
        // Redirecting to the product detail page when clicking on the image
        cartViewHolder.cartProductItemClickable.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                ProductHelper.redirectToProductDetail(getContext(), orderEntry.getProduct().getCode());
            }
        });

        // Loading the product image
        if (StringUtils.isNotBlank(orderEntry.getProduct().getImageThumbnailUrl())) {
            CommerceApplication.getContentServiceHelper().loadImage(
                    orderEntry.getProduct().getImageThumbnailUrl(), null, cartViewHolder.productImageView, 0, 0,
                    true, null, true);

        }

        // Name
        cartViewHolder.productNameTextView.setText(orderEntry.getProduct().getName());

        // Price
        if (orderEntry.getBasePrice() != null) {
            cartViewHolder.productPrice.setText(orderEntry.getBasePrice().getFormattedValue());
        }

        // Promotion
        if (orderEntry.getPromotionResult() != null) {
            cartViewHolder.productPromotion.setText(orderEntry.getPromotionResult().getDescription());
            cartViewHolder.productPromotion.setVisibility(View.VISIBLE);
        } else {
            cartViewHolder.productPromotion.setVisibility(View.GONE);

        }

        // Variants
        if (orderEntry.getProduct().getBaseOptions() != null
                && !orderEntry.getProduct().getBaseOptions().isEmpty()) {
            cartViewHolder.linearLayoutVariants.setVisibility(View.VISIBLE);
            cartViewHolder.linearLayoutVariants.removeAllViews();
        }

        // Quantity
        cartViewHolder.quantityEditText.setText(orderEntry.getQuantity() + "");

        // Reset the style after text changed in case of error
        cartViewHolder.quantityEditText.addTextChangedListener(new TextWatcher() {

            @Override
            public void afterTextChanged(Editable s) {
                cartViewHolder.quantityEditText.setBackgroundResource(R.drawable.quantity_editext);
            }

            @Override
            public void beforeTextChanged(CharSequence s, int start, int count, int after) {
            }

            @Override
            public void onTextChanged(CharSequence s, int start, int before, int count) {
            }

        });

        //  Update quantity to the cart
        cartViewHolder.quantityEditText.setOnEditorActionListener(new OnEditorActionListener() {

            @Override
            public boolean onEditorAction(final TextView v, int actionId, KeyEvent event) {

                try {
                    int quantity = Integer.parseInt(v.getText().toString());

                    if (quantity == 0) {
                        showDeleteItemDialog(position);
                    } else {
                        CartHelperBase.updateCart(getContext(), mRequestId, new OnAddToCart() {

                            @Override
                            public void onAddToCart(CartModification productAdded) {
                                // We remove the reference to the selected edittext
                                mSelectedQuantity = null;
                            }

                            @Override
                            public void onAddToCartError(boolean isOutOfStock) {
                                // Set the error for the field
                                v.setBackgroundResource(R.drawable.quantity_editext_invalid);
                            }
                        }, orderEntry.getEntryNumber(), quantity,
                                Collections.singletonList((View) cartViewHolder.quantityEditText), null);
                    }
                } catch (NumberFormatException e) {
                    Log.e(TAG, e.getLocalizedMessage());
                }

                return false;

            }
        });

        // Total price
        if (orderEntry.getTotalPrice() != null) {
            cartViewHolder.productTotalPrice.setText(orderEntry.getTotalPrice().getFormattedValue());
        }

        // Delete /Cancel item buttons
        cartViewHolder.cancelButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {
                mListViewSwipeable.resetLastSwipedItemPosition(true);
            }
        });

        cartViewHolder.deleteButton.setOnClickListener(new OnClickListener() {

            @Override
            public void onClick(View v) {

                QueryCartEntry queryCartEntry = new QueryCartEntry();
                queryCartEntry.setEntryNumber(position + "");
                CommerceApplication.getContentServiceHelper()
                        .deleteCartEntry(new ResponseReceiver<CartModification>() {
                            @Override
                            public void onResponse(Response<CartModification> response) {
                                updateCart();
                            }

                            @Override
                            public void onError(Response<ErrorList> response) {
                                UIUtils.showError(response, getContext());

                                // Update the cart
                                SessionHelper.updateCart(getContext(), mRequestId, false);

                            }
                        }, mRequestId, queryCartEntry, null, false, null, mOnRequestListener);
            }
        });

        // When save the quantity field reference in order to reset the default value when clicking outside the box
        cartViewHolder.quantityEditText.setOnFocusChangeListener(new OnFocusChangeListener() {

            @Override
            public void onFocusChange(View v, boolean hasFocus) {
                mSelectedQuantity = new CurrentQuantity((EditText) v, orderEntry.getQuantity().intValue());
            }
        });
    }
    return rowView;
}

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

public BigDecimal getHeizkosten() {
    try {/*from  w w  w .j  a  va 2s. c om*/
        return Is24CsvFormat.parseDecimal(this.get(FIELD_HEIZKOSTEN));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Heizkosten'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

public BigDecimal getStellplatzmiete() {
    try {//  www .  j  a  v  a2  s.  c om
        return Is24CsvFormat.parseDecimal(this.get(FIELD_STELLPLATZMIETE));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Stellplatzmiete'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

public Integer getBaujahr() {
    try {/*from  ww w .  j a  v  a2s  .co  m*/
        return Is24CsvFormat.parseInteger(this.get(FIELD_BAUJAHR));
    } catch (NumberFormatException ex) {
        LOGGER.warn("Can't read 'Baujahr'!");
        LOGGER.warn("> " + ex.getLocalizedMessage(), ex);
        return null;
    }
}

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

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