org.broadleafcommerce.common.util.xml
Class BigDecimalRoundingAdapter
java.lang.Object
javax.xml.bind.annotation.adapters.XmlAdapter<String,BigDecimal>
org.broadleafcommerce.common.util.xml.BigDecimalRoundingAdapter
public class BigDecimalRoundingAdapter
- extends XmlAdapter<String,BigDecimal>
This class allows us to round Big Decimals to 2 decimal places, generally for
marshalling purposes. This is to be used with javax.xml.bind.annotation.adapters.XmlJavaTypeAdapters.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BigDecimalRoundingAdapter
public BigDecimalRoundingAdapter()
unmarshal
public BigDecimal unmarshal(String s)
throws Exception
- Specified by:
unmarshal in class XmlAdapter<String,BigDecimal>
- Throws:
Exception
marshal
public String marshal(BigDecimal bigDecimal)
throws Exception
- Specified by:
marshal in class XmlAdapter<String,BigDecimal>
- Throws:
Exception
Copyright © 2013. All Rights Reserved.