Trovit/src/main/java/org/openestate/io/trovit/TrovitUtils.java
public static BigDecimal parseRoomsValue(String value) {
        value = StringUtils.trimToNull(value);
        if (value == null) return null;

        final Matcher m = ROOMS_INTERVAL.matcher(value);
        if (m.find()) {
            final int from = Integer.parseInt(m.group(1));
            final int to = Integer.parseInt(m.group(2));
            if ((to - from) != -1) {
                throw new IllegalArgumentException("Can't parse rooms value '" + value + "' because of an invalid interval!");
            }
            return DatatypeConverter.parseDecimal(to + ".5");
        }

        try {
            return DatatypeConverter.parseDecimal(value);
        } catch (NumberFormatException ex) {
            throw new IllegalArgumentException("Can't parse rooms value '" + value + "'!", ex);
        }
    }
public static BigDecimal parseRoomsValue(String value) {
        value = StringUtils.trimToNull(value);
        if (value == null) return null;

        final Matcher m = ROOMS_INTERVAL.matcher(value);
        if (m.find()) {
            final int from = Integer.parseInt(m.group(1));
            final int to = Integer.parseInt(m.group(2));
            if ((to - from) != -1) {
                throw new IllegalArgumentException("Can't parse rooms value '" + value + "' because of an invalid interval!");
            }
            return DatatypeConverter.parseDecimal(to + ".5");
        }

        try {
            return DatatypeConverter.parseDecimal(value);
        } catch (NumberFormatException ex) {
            throw new IllegalArgumentException("Can't parse rooms value '" + value + "'!", ex);
        }
    }
public static BigDecimal parseRoomsValue ( String value ) { value = StringUtils . trimToNull ( value ) ; if ( value == null ) return null ; final Matcher m = ROOMS_INTERVAL . matcher ( value ) ; if ( m . find ( ) ) { final int from = Integer . parseInt ( m . group ( 1 ) ) ; final int to = Integer . parseInt ( m . group ( 2 ) ) ; if ( ( to - from ) != - 1 ) { throw new IllegalArgumentException ( "Can't parse rooms value '" + value + "' because of an invalid interval!" ) ; } return DatatypeConverter . parseDecimal ( to + ".5" ) ; } try { return DatatypeConverter . parseDecimal ( value ) ; } catch ( NumberFormatException ex ) { throw new IllegalArgumentException ( "Can't parse rooms value '" + value + "'!" , ex ) ; } }
Read a {@link BigDecimal} value from XML for a number of rooms.

@param value XML string
@return parsed value or null, if the value is invalid
Read a { @link BigDecimal } value from XML for a number of rooms .