org.kiwiproject.xml.UncheckedJAXBException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kiwi Show documentation
Show all versions of kiwi Show documentation
Kiwi is a utility library. We really like Google's Guava, and also use Apache Commons.
But if they don't have something we need, and we think it is useful, this is where we put it.
package org.kiwiproject.xml;
import static org.kiwiproject.base.KiwiPreconditions.requireNotNull;
import javax.xml.bind.JAXBException;
/**
* Wraps a {@link JAXBException} with an unchecked exception.
*/
public class UncheckedJAXBException extends RuntimeException {
/**
* Construct an instance.
*
* @param message the message, which can be null
* @param cause the cause, which cannot be null
* @throws IllegalArgumentException if cause is null
*/
public UncheckedJAXBException(String message, JAXBException cause) {
super(message, requireNotNull(cause));
}
/**
* Construct an instance.
*
* @param cause the cause, which cannot be null
* @throws IllegalArgumentException if cause is null
*/
public UncheckedJAXBException(JAXBException cause) {
super(requireNotNull(cause));
}
/**
* Returns the cause of this exception.
*
* @return the {@link JAXBException} which is the cause of this exception
*/
@Override
public synchronized JAXBException getCause() {
return (JAXBException) super.getCause();
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy