add some more javadoc to ConfigException.java

This commit is contained in:
Havoc Pennington 2011-11-30 09:15:49 -05:00
parent 4896b7d75d
commit 9f9b351f0e

View File

@ -152,6 +152,11 @@ public class ConfigException extends RuntimeException {
} }
} }
/**
* Exception indicating that a path expression was invalid. Try putting
* double quotes around path elements that contain "special" characters.
*
*/
public static class BadPath extends ConfigException { public static class BadPath extends ConfigException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;
@ -267,6 +272,11 @@ public class ConfigException extends RuntimeException {
} }
} }
/**
* Information about a problem that occurred in {@link Config#checkValid}. A
* {@link ConfigException.ValidationFailed} exception thrown from
* <code>checkValid()</code> includes a list of problems encountered.
*/
public static class ValidationProblem { public static class ValidationProblem {
final private String path; final private String path;
@ -279,19 +289,31 @@ public class ConfigException extends RuntimeException {
this.problem = problem; this.problem = problem;
} }
/** Returns the config setting causing the problem. */
public String path() { public String path() {
return path; return path;
} }
/**
* Returns where the problem occurred (origin may include info on the
* file, line number, etc.).
*/
public ConfigOrigin origin() { public ConfigOrigin origin() {
return origin; return origin;
} }
/** Returns a description of the problem. */
public String problem() { public String problem() {
return problem; return problem;
} }
} }
/**
* Exception indicating that {@link Config#checkValid} found validity
* problems. The problems are available via the {@link #problems()} method.
* The <code>getMessage()</code> of this exception is a potentially very
* long string listing all the problems found.
*/
public static class ValidationFailed extends ConfigException { public static class ValidationFailed extends ConfigException {
private static final long serialVersionUID = 1L; private static final long serialVersionUID = 1L;