Note that the message must include a %s for the message from the parameter.
@Message("Binding to %s failed: %s")
IOException bindFailed(SocketAddress address,
@TransformException({ BindException.class, SocketException.class }) IOException toCopy);
In the above example an exception is created based on the toCopy parameter. If the toCopy parameter
is a java.net.BindException then a java.net.BindException is created and the stack trace from the
toCopy parameter is copied to the newly created exception. This will happen for each type listed as a value,
finally falling back to an java.io.IOException if the parameter is not an instance of the suggested types.
The message for the newly created exception will be; "Binding to address.toString() failed:
toCopy.getLocalizedMessage()".
| Modifier and Type | Method and Description |
|---|---|
| public boolean | Returns: true if the stack trace should be copied to the newly created exceptionIndicates if the stack trace from the parameter should be copied to the exception returned. |
| public Class |
| copyStackTrace | back to summary |
|---|---|
| public boolean copyStackTrace() Indicates if the stack trace from the parameter should be copied to the exception returned.
If
| |
| value | back to summary |
|---|---|
| public Class An array of suggested types to create. Each type must be a super type of the parameter. | |