Java Code Examples for javax.xml.bind.DatatypeConverter#parseInteger()
The following examples show how to use
javax.xml.bind.DatatypeConverter#parseInteger() .
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: SimpleTypeAnalyzer.java From hyperjaxb3 with BSD 2-Clause "Simplified" License | 6 votes |
public Long getValue(XSFacet facet) { final XmlString value = facet.getValue(); if (value == null) { return null; } else { final String v = value.value; if (v == null) { return null; } else { final BigInteger integerValue = DatatypeConverter.parseInteger(v); if (integerValue.compareTo(BigInteger .valueOf(Long.MAX_VALUE)) > 0) { return Long.MAX_VALUE; } else { return integerValue.longValue(); } } } }
Example 2
Source File: SimpleTypeBuilder.java From jdk8u60 with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 3
Source File: TrovitUtils.java From OpenEstate-IO with Apache License 2.0 | 5 votes |
/** * Read a {@link BigInteger} value from XML for a year number. * * @param value XML string * @return parsed value or null, if the value is invalid */ public static BigInteger parseYearValue(String value) { try { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; } catch (NumberFormatException ex) { throw new IllegalArgumentException("Can't parse year value '" + value + "'!", ex); } }
Example 4
Source File: TrovitUtils.java From OpenEstate-IO with Apache License 2.0 | 5 votes |
/** * Read a {@link BigInteger} value from XML for a plot area. * * @param value XML string * @return parsed value or null, if the value is invalid */ public static BigInteger parsePlotAreaValue(String value) { try { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; } catch (NumberFormatException ex) { throw new IllegalArgumentException("Can't parse plot area value '" + value + "'!", ex); } }
Example 5
Source File: TrovitUtils.java From OpenEstate-IO with Apache License 2.0 | 5 votes |
/** * Read a {@link BigInteger} value from XML for a floor area. * * @param value XML string * @return parsed value or null, if the value is invalid */ public static BigInteger parseFloorAreaValue(String value) { try { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; } catch (NumberFormatException ex) { throw new IllegalArgumentException("Can't parse floor area value '" + value + "'!", ex); } }
Example 6
Source File: OpenImmoUtils.java From OpenEstate-IO with Apache License 2.0 | 5 votes |
public static BigInteger parseInteger(String value) { value = StringUtils.trimToNull(value); if (value == null) return null; try { return DatatypeConverter.parseInteger(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException("Can't parse integer value '" + value + "'! " + ex.getLocalizedMessage()); } }
Example 7
Source File: ImmoXmlUtils.java From OpenEstate-IO with Apache License 2.0 | 5 votes |
public static BigInteger parseInteger(String value) { value = StringUtils.trimToNull(value); if (value == null) return null; try { return DatatypeConverter.parseInteger(value); } catch (NumberFormatException ex) { throw new IllegalArgumentException("Can't parse integer value '" + value + "'! " + ex.getLocalizedMessage()); } }
Example 8
Source File: SimpleTypeBuilder.java From openjdk-8 with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 9
Source File: SimpleTypeBuilder.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 10
Source File: SimpleTypeBuilder.java From hottub with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 11
Source File: SimpleTypeBuilder.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 12
Source File: SimpleTypeBuilder.java From openjdk-jdk8u-backup with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 13
Source File: SimpleTypeBuilder.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 14
Source File: SimpleTypeBuilder.java From TencentKona-8 with GNU General Public License v2.0 | 5 votes |
private BigInteger readFacet(String facetName,int offset) { XSFacet me = initiatingType.getFacet(facetName); if(me==null) return null; BigInteger bi = DatatypeConverter.parseInteger(me.getValue().value); if(offset!=0) bi = bi.add(BigInteger.valueOf(offset)); return bi; }
Example 15
Source File: ValueConverter.java From java-client-api with Apache License 2.0 | 4 votes |
static public Object convertToJava(String type, String value) { if ("xs:anySimpleType".equals(type)) return DatatypeConverter.parseAnySimpleType(value); if ("xs:base64Binary".equals(type)) return DatatypeConverter.parseBase64Binary(value); if ("xs:boolean".equals(type)) return StringToBoolean(value); if ("xs:byte".equals(type)) return DatatypeConverter.parseByte(value); if ("xs:date".equals(type)) return DatatypeConverter.parseDate(value); if ("xs:dateTime".equals(type)) return DatatypeConverter.parseDateTime(value); if ("xs:dayTimeDuration".equals(type)) return Utilities.getDatatypeFactory().newDurationDayTime(value); if ("xs:decimal".equals(type)) return DatatypeConverter.parseDecimal(value); if ("xs:double".equals(type)) return StringToDouble(value); if ("xs:duration".equals(type)) return Utilities.getDatatypeFactory().newDuration(value); if ("xs:float".equals(type)) return StringToFloat(value); if ("xs:int".equals(type)) return StringToInteger(value); if ("xs:integer".equals(type)) return DatatypeConverter.parseInteger(value); if ("xs:long".equals(type)) return StringToLong(value); if ("xs:short".equals(type)) return DatatypeConverter.parseShort(value); if ("xs:string".equals(type)) return DatatypeConverter.parseString(value); if ("xs:time".equals(type)) return DatatypeConverter.parseTime(value); if ("xs:unsignedInt".equals(type)) return DatatypeConverter.parseUnsignedInt(value); if ("xs:unsignedLong".equals(type)) { BigInteger bi = DatatypeConverter.parseInteger(value); if (bi.compareTo(MAX_UNSIGNED_LONG) < 0) { return bi.longValue(); } else { return bi; } } if ("xs:unsignedShort".equals(type)) return DatatypeConverter.parseUnsignedShort(value); if ("xs:yearMonthDuration".equals(type)) return Utilities.getDatatypeFactory().newDurationYearMonth(value); return value; }
Example 16
Source File: WisItUtils.java From OpenEstate-IO with Apache License 2.0 | 4 votes |
public static BigInteger parsePositiveInteger(String value) { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; }
Example 17
Source File: DaftIeUtils.java From OpenEstate-IO with Apache License 2.0 | 4 votes |
public static BigInteger parsePositiveInteger(String value) { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; }
Example 18
Source File: KyeroUtils.java From OpenEstate-IO with Apache License 2.0 | 4 votes |
public static BigInteger parseInteger(String value) { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; }
Example 19
Source File: KyeroUtils.java From OpenEstate-IO with Apache License 2.0 | 4 votes |
public static BigInteger parseNonNegativeInteger(String value) { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; }
Example 20
Source File: ImmobiliareItUtils.java From OpenEstate-IO with Apache License 2.0 | 4 votes |
public static BigInteger parseInteger(String value) { value = StringUtils.trimToNull(value); return (value != null) ? DatatypeConverter.parseInteger(value) : null; }