Java Code Examples for javax.xml.bind.DatatypeConverter#parseInt()

The following examples show how to use javax.xml.bind.DatatypeConverter#parseInt() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CloverIntegerConvertor.java    From CloverETL-Engine with GNU Lesser General Public License v2.1 5 votes vote down vote up
public static Integer parseXsdIntToInteger(String value) throws DataConversionException {
  	Integer result = null;
      
try {
	result = DatatypeConverter.parseInt(value);
} catch (Exception e) {
	logger.fatal("Unable to parse xsd:int to " + Integer.class.getName() + ".", e);
	throw new DataConversionException("Unable to parse xsd:int to " + Integer.class.getName() + ".", e);
}
      
      return result;
  }
 
Example 2
Source File: ValueConverter.java    From java-client-api with Apache License 2.0 5 votes vote down vote up
static public int StringToIntegerPrimitive(String value) {
  try {
    return DatatypeConverter.parseInt(value);
  } catch(Exception e) {
    throw new IllegalArgumentException("Could not convert to int: "+value, e);
  }
}
 
Example 3
Source File: NumberUtil.java    From jpmml-model with BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
static
public Number parseNumber(String value){

	try {
		return DatatypeConverter.parseInt(value);
	} catch(NumberFormatException nfe){
		return DatatypeConverter.parseDouble(value);
	}
}
 
Example 4
Source File: KyeroUtils.java    From OpenEstate-IO with Apache License 2.0 4 votes vote down vote up
public static Integer parseImageAttributeType(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseInt(value) : null;
}
 
Example 5
Source File: ImmobiliareItUtils.java    From OpenEstate-IO with Apache License 2.0 4 votes vote down vote up
public static Integer parseRooms(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseInt(value) : null;
}
 
Example 6
Source File: ImmobiliareItUtils.java    From OpenEstate-IO with Apache License 2.0 4 votes vote down vote up
public static Integer parseYear(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseInt(value) : null;
}
 
Example 7
Source File: XsValueImpl.java    From java-client-api with Apache License 2.0 4 votes vote down vote up
public IntValImpl(String value) {
    this(DatatypeConverter.parseInt(value));
}
 
Example 8
Source File: NumberUtil.java    From jpmml-model with BSD 3-Clause "New" or "Revised" License 4 votes vote down vote up
static
public Integer parseInteger(String value){
	return DatatypeConverter.parseInt(value);
}