Package java.util

Examples of java.util.UnknownFormatConversionException


    /**
     * @tests serialization/deserialization.
     */
    public void testSerializationSelf() throws Exception {

        SerializationTest.verifySelf(new UnknownFormatConversionException(
                "MYTESTSTRING"), exComparator);
    }
View Full Code Here


     * @tests serialization/deserialization compatibility with RI.
     */
    public void testSerializationCompatibility() throws Exception {

        SerializationTest.verifyGolden(this,
                new UnknownFormatConversionException("MYTESTSTRING"),
                exComparator);
    }
View Full Code Here

    public static String applyNamingStrategy(String name, NamingStrategy namingStrategy) {
        switch (namingStrategy) {
            case SNAKE_CASE: return toSnakeCase(name);
            case CASE_SENSITIVE: return toCaseSensitive(name);
            case LOWER_CASE: return name.toLowerCase();
            default: throw new UnknownFormatConversionException(format("Cannot convert name '%s' to unknow naming strategy '%s'", name, namingStrategy.name()));
        }
    }
View Full Code Here

    int idx;
    // If there are any '%' in the given string, we got a bad format
    // specifier.
    if ((idx = s.indexOf('%')) != -1) {
      char c = (idx > s.length() - 2 ? '%' : s.charAt(idx + 1));
      throw new UnknownFormatConversionException(String.valueOf(c));
    }
  }
View Full Code Here

  private char conversion(String s) {
    c = s.charAt(0);
    if (!dt) {
      if (!Conversion.isValid(c))
        throw new UnknownFormatConversionException(String.valueOf(c));
      if (Character.isUpperCase(c))
        f.add(Flags.UPPERCASE);
      c = Character.toLowerCase(c);
      if (Conversion.isText(c))
        index = -2;
View Full Code Here

    else if (Conversion.isFloat(c))
      checkFloat();
    else if (Conversion.isText(c))
      checkText();
    else
      throw new UnknownFormatConversionException(String.valueOf(c));
  }
View Full Code Here

  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
    if (width == -1 && f.contains(Flags.LEFT_JUSTIFY))
      throw new MissingFormatWidthException(toString());
View Full Code Here

        throw new IllegalFormatWidthException(width);
      if (f.valueOf() != Flags.NONE.valueOf())
        throw new IllegalFormatFlagsException(f.toString());
      break;
    default:
            throw new UnknownFormatConversionException(String.valueOf(c));
    }
  }
View Full Code Here

      case Conversion.HASHCODE:
      case Conversion.LINE_SEPARATOR:
      case Conversion.PERCENT_SIGN:
        break;
      default:
                throw new UnknownFormatConversionException(String.valueOf(c));
      }
    } catch (IllegalFormatConversionException e) {
      e.setArgIndex(argIndex);
      throw e;
    }
View Full Code Here

    {
      return StringUtils.parseDate(dateTime);
    }
    catch (ParseException e)
    {
      UnknownFormatConversionException exc = new UnknownFormatConversionException(dateTime);
      exc.initCause(e);
      throw exc;
    }
  }
View Full Code Here

TOP

Related Classes of java.util.UnknownFormatConversionException

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.