Package java.util

Examples of java.util.InputMismatchException


         final Locale locale = urlParts.length > 6 ? new Locale(urlParts[6]) : Locale.getDefault();

         final BufferedReader reader = new BufferedReader(new StringReader(iRequest.content));
         String header = reader.readLine();
         if (header==null || (header=header.trim()).length() == 0)
           throw new InputMismatchException("Missing CSV file header");

         final List<String> columns = OStringSerializerHelper.smartSplit(header, separator);
         for (int i = 0; i < columns.size(); ++i)
           columns.set(i, OStringSerializerHelper.getStringContent(columns.get(i)));
View Full Code Here


        String key = parser.nextKey();
        if (key.equals("base")) {
          if (relativeBaseDN != null) {
            // Relative base DN specified more than once.
            throw new InputMismatchException();
          }
          relativeBaseDN = DN.decode(parser.nextStringValue());
        } else if (key.equals("minimum")) {
          if (minimum != -1) {
            // Minimum specified more than once.
            throw new InputMismatchException();
          }
          minimum = parser.nextInt();
        } else if (key.equals("maximum")) {
          if (maximum != -1) {
            // Maximum specified more than once.
            throw new InputMismatchException();
          }
          maximum = parser.nextInt();
        } else if (key.equals("specificationfilter")) {
          if (refinement != null) {
            // Refinements specified more than once.
            throw new InputMismatchException();
          }

          refinement = parseRefinement(parser);
        } else if (key.equals("specificexclusions")) {
          if (!chopBefore.isEmpty() || !chopAfter.isEmpty()) {
            // Specific exclusions specified more than once.
            throw new InputMismatchException();
          }

          parser.nextSpecificExclusions(chopBefore, chopAfter);
        } else {
          throw new InputMismatchException();
        }
      }

      // Make default minimum value is 0.
      if (minimum < 0) {
View Full Code Here

    } else if (type.equals("or")) {
      ArrayList<Refinement> refinements = parseRefinementSet(parser);
      return new OrRefinement(refinements);
    } else {
      // Unknown refinement type.
      throw new InputMismatchException();
    }
  }
View Full Code Here

   * @throws InputMismatchException if <code>value &lt; 0</code> or
   *     <code>value &gt; max</code>.
   */
  private int checkUnsigned(int value, int max) {
    if (value < 0 || value > max) {
      throw new InputMismatchException("Unsigned value out of range.");
    }
    return value;
  }
View Full Code Here

   * @throws InputMismatchException if <code>value &lt; 0</code> or
   *     <code>value &gt; max</code>.
   */
  private long checkUnsigned(long value, long max) {
    if (value < 0 || value > max) {
      throw new InputMismatchException("Unsigned value out of range.");
    }
    return value;
  }
View Full Code Here

    public static void verifyTitleID(String toVerify) throws InputMismatchException {
        Pattern pattern = Pattern.compile("^[A-Za-z0-9_]+$");
        Matcher matcher = pattern.matcher(toVerify);
        if (!matcher.find())
            throw new InputMismatchException("Title ID can only contain alphanumberic characters and underscores.");
    }
View Full Code Here

        if (actual.equals(expected))
            return;

        String msg;
        msg = String.format("'%s' expected, '%s' got", expected, actual);
        throw new InputMismatchException(msg);
    }
View Full Code Here

            return parseTableEventMap(parser);

        if ("NULL".equals(token))
            return null;

        throw new InputMismatchException(token);
    }
View Full Code Here

  private static byte[] inbuf = new byte[1024];
  static int lenbuf = 0, ptrbuf = 0;
 
  private static int readByte()
  {
    if(lenbuf == -1)throw new InputMismatchException();
    if(ptrbuf >= lenbuf){
      ptrbuf = 0;
      try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
      if(lenbuf <= 0)return -1;
    }
    return inbuf[ptrbuf++];
  }
View Full Code Here

  private static byte[] inbuf = new byte[1024];
  static int lenbuf = 0, ptrbuf = 0;
 
  private static int readByte()
  {
    if(lenbuf == -1)throw new InputMismatchException();
    if(ptrbuf >= lenbuf){
      ptrbuf = 0;
      try { lenbuf = is.read(inbuf); } catch (IOException e) { throw new InputMismatchException(); }
      if(lenbuf <= 0)return -1;
    }
    return inbuf[ptrbuf++];
  }
View Full Code Here

TOP

Related Classes of java.util.InputMismatchException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.