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

The following examples show how to use javax.xml.bind.DatatypeConverter#parseInt() . These examples are extracted from open source projects. 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
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 Project: java-client-api   File: ValueConverter.java    License: 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
static
public Number parseNumber(String value){

	try {
		return DatatypeConverter.parseInt(value);
	} catch(NumberFormatException nfe){
		return DatatypeConverter.parseDouble(value);
	}
}
 
Example 4
Source Project: OpenEstate-IO   File: KyeroUtils.java    License: 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
public static Integer parseRooms(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseInt(value) : null;
}
 
Example 6
public static Integer parseYear(String value) {
    value = StringUtils.trimToNull(value);
    return (value != null) ? DatatypeConverter.parseInt(value) : null;
}
 
Example 7
Source Project: java-client-api   File: XsValueImpl.java    License: Apache License 2.0 4 votes vote down vote up
public IntValImpl(String value) {
    this(DatatypeConverter.parseInt(value));
}
 
Example 8
static
public Integer parseInteger(String value){
	return DatatypeConverter.parseInt(value);
}