public void checkValid(String value, ValidationContext context) throws DatatypeException {
   super.checkValid(value, context);
   int len = value.length();
   if (len == 0) throw new DatatypeException(0, "invalid non-negative integer value");
   boolean negative = false;
   for (int i = 0; i < len; i++) {
     char c = value.charAt(i);
     if (c == 0x30) continue;
     else if (c >= 0x31 && c <= 0x39) {
       if (negative) throw new DatatypeException(i, "invalid non-negative integer value");
       continue;
     } else if (c == '+' && i == 0) continue;
     else if (c == '-' && i == 0) {
       negative = true;
       continue;
     }
     throw new DatatypeException(i, "invalid non-negative integer value");
   }
 }
Exemple #2
0
 public void checkValid(String value, ValidationContext context) throws DatatypeException {
   super.checkValid(value, context);
   // TODO
 }