Example usage for org.apache.commons.beanutils NestedNullException getLocalizedMessage

List of usage examples for org.apache.commons.beanutils NestedNullException getLocalizedMessage

Introduction

In this page you can find the example usage for org.apache.commons.beanutils NestedNullException getLocalizedMessage.

Prototype

public String getLocalizedMessage() 

Source Link

Document

Creates a localized description of this throwable.

Usage

From source file:de.hybris.platform.commercefacades.address.converters.populator.SingleLineAddressFormatPopulator.java

@Override
public void populate(final AddressModel addressModel, final StringBuilder addressLine)
        throws ConversionException {
    for (final String field : addressFormatList) {
        try {/*from ww w . j  a  v  a 2s. c  o  m*/
            final String fieldValue = (String) PropertyUtils.getProperty(addressModel, field);
            if (fieldValue != null) {
                addressLine.append(fieldValue);
                addressLine.append(", ");
            }
        } catch (final NestedNullException e) {
            if (LOG.isDebugEnabled()) {
                LOG.debug(e.getLocalizedMessage());
            }
        } catch (final Exception e) {
            throw new ConversionException(e.getLocalizedMessage());
        }
    }

    if (addressLine.length() > 2) {
        // Trim last ", "
        addressLine.setLength(addressLine.length() - 2);
    }
}