Top Description Fields Constructors Methods
org.joda.money.format

public Class MoneyFormatException

extends RuntimeException
Class Inheritance
Imports
java.io.IOException

Exception thrown during monetary formatting.

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

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
MoneyFormatException(String
the message
message
)

Constructor taking a message.

public
MoneyFormatException(String
the message
message
,
Throwable
the exception cause
cause
)

Constructor taking a message and cause.

Method Summary

Modifier and TypeMethod and Description
public void
rethrowIOException()

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.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Serialization lock.

Constructor Detail

MoneyFormatExceptionback to summary
public MoneyFormatException(String message)

Constructor taking a message.

Parameters
message:String

the message

MoneyFormatExceptionback to summary
public MoneyFormatException(String message, Throwable cause)

Constructor taking a message and cause.

Parameters
message:String

the message

cause:Throwable

the exception cause

Method Detail

rethrowIOExceptionback to summary
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) {
  ex.rethrowIOException();
  // 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.
Exceptions
IOException:
if the cause of this exception is an IOException