All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.kiwiproject.xml.UncheckedJAXBException Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.5.2
Show newest version
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