Class MoneyFormatException

  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by
All Implemented Interfaces:

public class MoneyFormatException
extends RuntimeException

Exception thrown during monetary formatting.

This exception makes no guarantees about immutability or thread-safety.

See Also:
Serialized Form

Constructor Summary
MoneyFormatException(String message)
          Constructor taking a message.
MoneyFormatException(String message, Throwable cause)
          Constructor taking a message and cause.
Method Summary
 void rethrowIOException()
          Checks if the cause of this exception was an IOException, and if so re-throws it
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

Constructor Detail


public MoneyFormatException(String message)
Constructor taking a message.

message - the message


public MoneyFormatException(String message,
                            Throwable cause)
Constructor taking a message and cause.

message - the message
cause - the exception cause
Method Detail


public void rethrowIOException()
                        throws IOException
Checks if the cause of this exception was an IOException, and if so re-throws it

This method is useful if you call a printer with an open stream or writer and want to ensure that IOExceptions are not lost.

 try {
   printer.print(writer, money);
 } catch (CalendricalFormatException ex) {
   // if code reaches here exception was caused by issues other than IO
Note that calling this method will re-throw the original IOException, causing this MoneyFormatException to be lost.

IOException - if the cause of this exception is an IOException

Copyright © 2009–2013 All rights reserved.