Package java.util

Examples of java.util.IllegalFormatPrecisionException


        Flags.GROUP, Flags.PARENTHESES);
  }

  private void checkDateTime() throws FormatFlagsConversionMismatchException {
    if (precision != -1)
      throw new IllegalFormatPrecisionException(precision);
    if (!DateTime.isValid(c))
      throw new UnknownFormatConversionException("t" + c);
    checkBadFlags(Flags.ALTERNATE, Flags.PLUS, Flags.LEADING_SPACE,
        Flags.ZERO_PAD, Flags.GROUP, Flags.PARENTHESES);
    // '-' requires a width
View Full Code Here


      throw new MissingFormatWidthException(toString());
  }

  private void checkCharacter() throws FormatFlagsConversionMismatchException {
    if (precision != -1)
      throw new IllegalFormatPrecisionException(precision);
    checkBadFlags(Flags.ALTERNATE, Flags.PLUS, Flags.LEADING_SPACE,
        Flags.ZERO_PAD, Flags.GROUP, Flags.PARENTHESES);
    // '-' requires a width
    if (width == -1 && f.contains(Flags.LEFT_JUSTIFY))
      throw new MissingFormatWidthException(toString());
View Full Code Here

  }

  private void checkInteger() throws FormatFlagsConversionMismatchException {
    checkNumeric();
    if (precision != -1)
      throw new IllegalFormatPrecisionException(precision);

    if (c == Conversion.DECIMAL_INTEGER)
      checkBadFlags(Flags.ALTERNATE);
    else
      checkBadFlags(Flags.GROUP);
View Full Code Here

  private void checkNumeric() {
    if (width != -1 && width < 0)
      throw new IllegalFormatWidthException(width);

    if (precision != -1 && precision < 0)
      throw new IllegalFormatPrecisionException(precision);

    // '-' and '0' require a width
    if (width == -1
        && (f.contains(Flags.LEFT_JUSTIFY) || f
            .contains(Flags.ZERO_PAD)))
View Full Code Here

      throw new IllegalFormatFlagsException(f.toString());
  }

  private void checkText() {
    if (precision != -1)
      throw new IllegalFormatPrecisionException(precision);
    switch (c) {
    case Conversion.PERCENT_SIGN:
      if (f.valueOf() != Flags.LEFT_JUSTIFY.valueOf()
          && f.valueOf() != Flags.NONE.valueOf())
        throw new IllegalFormatFlagsException(f.toString());
View Full Code Here

    if (s != null) {
      try {
        // remove the '.'
        precision = Integer.parseInt(s.substring(1));
        if (precision < 0)
          throw new IllegalFormatPrecisionException(precision);
      } catch (NumberFormatException x) {
        assert (false);
      }
    }
    return precision;
View Full Code Here

        Flags.GROUP, Flags.PARENTHESES);
  }

  private void checkDateTime() throws FormatFlagsConversionMismatchException {
    if (precision != -1)
      throw new IllegalFormatPrecisionException(precision);
    if (!DateTime.isValid(c))
      throw new UnknownFormatConversionException("t" + c);
    checkBadFlags(Flags.ALTERNATE, Flags.PLUS, Flags.LEADING_SPACE,
        Flags.ZERO_PAD, Flags.GROUP, Flags.PARENTHESES);
    // '-' requires a width
View Full Code Here

      throw new MissingFormatWidthException(toString());
  }

  private void checkCharacter() throws FormatFlagsConversionMismatchException {
    if (precision != -1)
      throw new IllegalFormatPrecisionException(precision);
    checkBadFlags(Flags.ALTERNATE, Flags.PLUS, Flags.LEADING_SPACE,
        Flags.ZERO_PAD, Flags.GROUP, Flags.PARENTHESES);
    // '-' requires a width
    if (width == -1 && f.contains(Flags.LEFT_JUSTIFY))
      throw new MissingFormatWidthException(toString());
View Full Code Here

  }

  private void checkInteger() throws FormatFlagsConversionMismatchException {
    checkNumeric();
    if (precision != -1)
      throw new IllegalFormatPrecisionException(precision);

    if (c == Conversion.DECIMAL_INTEGER)
      checkBadFlags(Flags.ALTERNATE);
    else
      checkBadFlags(Flags.GROUP);
View Full Code Here

  private void checkNumeric() {
    if (width != -1 && width < 0)
      throw new IllegalFormatWidthException(width);

    if (precision != -1 && precision < 0)
      throw new IllegalFormatPrecisionException(precision);

    // '-' and '0' require a width
    if (width == -1
        && (f.contains(Flags.LEFT_JUSTIFY) || f
            .contains(Flags.ZERO_PAD)))
View Full Code Here

TOP

Related Classes of java.util.IllegalFormatPrecisionException

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.