示例#1
0
 /**
  * Conversion to text form.
  *
  * @return count as text
  */
 public String toString() {
   if (m_unbounded) {
     return "unbounded";
   } else {
     return Utility.serializeInt(m_count);
   }
 }
示例#2
0
 /**
  * Deserializer method for bounded values.
  *
  * @param value text representation
  * @return instance of class
  * @throws JiBXException on conversion error
  */
 public static Count getBoundedCount(String value) throws JiBXException {
   if (value == null) {
     return null;
   } else {
     value = value.trim();
     if ("0".equals(value)) {
       return COUNT_ZERO;
     } else if ("1".equals(value)) {
       return COUNT_ONE;
     } else {
       return new Count(Utility.parseInt(value), false);
     }
   }
 }