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

The following examples show how to use javax.xml.bind.DatatypeConverter#printLong() . 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: Is24XmlUtils.java    From OpenEstate-IO with 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 File: Is24XmlUtils.java    From OpenEstate-IO with 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 File: Is24XmlUtils.java    From OpenEstate-IO with 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 File: Is24XmlUtils.java    From OpenEstate-IO with 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 File: Is24XmlUtils.java    From OpenEstate-IO with 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 File: Is24XmlUtils.java    From OpenEstate-IO with 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 File: Is24XmlUtils.java    From OpenEstate-IO with 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 File: Is24XmlUtils.java    From OpenEstate-IO with 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
Source File: CloverLongConvertor.java    From CloverETL-Engine with GNU Lesser General Public License v2.1 5 votes vote down vote up
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 File: KyeroUtils.java    From OpenEstate-IO with 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 File: ValueConverter.java    From java-client-api with Apache License 2.0 4 votes vote down vote up
static public String LongPrimitiveToString(long value) {
  return DatatypeConverter.printLong(value);
}
 
Example 12
Source File: XsValueImpl.java    From java-client-api with Apache License 2.0 4 votes vote down vote up
@Override
public String toString() {
    return DatatypeConverter.printLong(value);
}