org.mapfish.print.wrapper.json.InvalidJsonValueException Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of print-lib Show documentation
Show all versions of print-lib Show documentation
Library for generating PDFs and images from online webmapping services
package org.mapfish.print.wrapper.json;
import org.mapfish.print.PrintException;
import org.mapfish.print.wrapper.PElement;
/**
* Thrown when an attribute has an invalid value in the spec.
*/
public class InvalidJsonValueException extends PrintException {
private static final long serialVersionUID = 1L;
/**
* Constructor.
*
* @param element element that was queried
* @param key key that was desired
* @param value the illegal value obtained.
*/
public InvalidJsonValueException(final PElement element, final String key, final Object value) {
this(element, key, value, null);
}
/**
* Constructor.
*
* @param element element that was queried
* @param key key that was desired
* @param value the illegal value obtained.
* @param e the exception to wrap by this exception
*/
public InvalidJsonValueException(
final PElement element, final String key, final Object value, final Throwable e) {
super(element.getPath(key) + " has an invalid value: " + value.toString(), e);
}
@Override
public final String toString() {
if (getCause() != null) {
return super.toString() + " (" + getCause().getMessage() + ")";
} else {
return super.toString();
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy