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

The following examples show how to use javax.xml.bind.DatatypeConverter#printLong() . 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
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl2(Long value) {
    if (value == null || value <= 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 2)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 2 digits.");
    return val;
}
 
Example 2
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl2Including0(Long value) {
    if (value == null || value < 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 2)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 2 digits.");
    return val;
}
 
Example 3
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl3(Long value) {
    if (value == null || value <= 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 3)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 3 digits.");
    return val;
}
 
Example 4
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl3Including0(Long value) {
    if (value == null || value < 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 3)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 3 digits.");
    return val;
}
 
Example 5
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl4(Long value) {
    if (value == null || value <= 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 4)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 4 digits.");
    return val;
}
 
Example 6
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl5(Long value) {
    if (value == null || value <= 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 5)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 5 digits.");
    return val;
}
 
Example 7
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl8(Long value) {
    if (value == null || value <= 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 8)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 8 digits.");
    return val;
}
 
Example 8
Source Project: OpenEstate-IO   File: Is24XmlUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static String printZahl10(Long value) {
    if (value == null || value <= 0)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'!");
    String val = DatatypeConverter.printLong(value);
    if (val.length() > 10)
        throw new IllegalArgumentException("Can't print integer value '" + value + "'! The value exceeds maximal length of 10 digits.");
    return val;
}
 
Example 9
public static String printLongToXsdLong(Long value) throws DataConversionException {
      String result = null;
      
      try {
	result = DatatypeConverter.printLong(value);
} catch (Exception e) {
	logger.fatal("Unable to print " + Long.class.getName() + " to xsd:long.", e);
	throw new DataConversionException("Unable to print " + Long.class.getName() + " to xsd:long.", e);
      }
      
      return result;
  }
 
Example 10
Source Project: OpenEstate-IO   File: KyeroUtils.java    License: Apache License 2.0 4 votes vote down vote up
public static String printPriceType(Long value) {
    return (value != null) ?
            DatatypeConverter.printLong(value) : "x";
}
 
Example 11
Source Project: java-client-api   File: ValueConverter.java    License: Apache License 2.0 4 votes vote down vote up
static public String LongPrimitiveToString(long value) {
  return DatatypeConverter.printLong(value);
}
 
Example 12
Source Project: java-client-api   File: XsValueImpl.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return DatatypeConverter.printLong(value);
}