Java Formatter Usage formatMessageException(String format, Object... args)

Here you can find the source of formatMessageException(String format, Object... args)

Description

format Message Exception

License

Apache License

Declaration

public static Exception formatMessageException(String format, Object... args) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.Formatter;

public class Main {
    public static Exception formatMessageException(String format, Object... args) {
        StringBuilder mes = new StringBuilder();
        Formatter f = new Formatter(mes);

        f.format(format, args);// ww  w  .  j a  va 2 s.co  m

        f.close();

        return new Exception(mes.toString());
    }
}

Related

  1. format(Locale l, String format, Object... args)
  2. format(String format, Object... args)
  3. format_hh_mm_ss_Optional(final long value)
  4. format_mm_ss(final long time)
  5. formatLong(long number, int length)
  6. formatNumber(int number)
  7. formatResponse(Formatter formatter, String response)
  8. formatTzname(final String format, final String letter)
  9. formatv(String format, Object[] args)