Example usage for javax.xml.bind DatatypeConverter parseDecimal

List of usage examples for javax.xml.bind DatatypeConverter parseDecimal

Introduction

In this page you can find the example usage for javax.xml.bind DatatypeConverter parseDecimal.

Prototype

public static java.math.BigDecimal parseDecimal(String lexicalXSDDecimal) 

Source Link

Document

Converts the string argument into a BigDecimal value.

Usage

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a {@link BigDecimal} value from XML
 * with maximal 13 digits and 2 decimal places.
 *
 * @param value//from  w ww .  ja va  2s . com
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parseDecimal13_2(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a positive {@link BigDecimal} value from XML
 * with maximal 3 decimal places./*  w w  w.jav a  2  s.  c  om*/
 *
 * @param value
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parseDecimalPositive(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a {@link BigDecimal} value from XML
 * with a valid latitude range.//from w w w  .  j av a 2s.  c  o  m
 *
 * @param value
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parseLatitude(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a {@link BigDecimal} value from XML
 * with a valid longitude range.//from  w  w w . j  a  va  2  s  .co  m
 *
 * @param value
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parseLongitude(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a {@link BigDecimal} value from XML,
 * that matches the 'PriceMultiplierType' simple type.
 *
 * @param value/* w ww. j  a v  a2s  .c  o  m*/
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parsePriceMultiplier(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a {@link BigDecimal} value from XML,
 * that matches the 'NumberOfRoomsType' simple type.
 *
 * @param value//from   w  w  w  . j a va  2s  .c  om
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parseRoomNr(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a {@link BigDecimal} value from XML,
 * that matches the type of the 'numberOfRooms' element in "BaseHouse".
 *
 * @param value//from  w ww.  j  a  v  a  2 s  . c  om
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parseRoomNrForBaseHouse(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}

From source file:org.openestate.is24.restapi.utils.XmlUtils.java

/**
 * Read a {@link BigDecimal} value from XML,
 * that matches the type of the "thermalCharacteristic" element.
 *
 * @param value//w w  w .ja v a2  s .co  m
 * XML string
 *
 * @return
 * parsed value or null, if the value is invalid
 */
public static BigDecimal parseThermalCharacteristic(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseDecimal(value) : null;
}