View Javadoc

1   package com.atlassian.plugin.util.validation;
2   
3   import com.atlassian.plugin.PluginParseException;
4   import com.google.common.collect.ImmutableList;
5   
6   import java.util.List;
7   
8   import static com.google.common.base.Preconditions.checkNotNull;
9   
10  /**
11   * Exception for a validation error parsing DOM4J nodes
12   *
13   * @since 2.2.0
14   */
15  public class ValidationException extends PluginParseException
16  {
17      private final List<String> errors;
18  
19      public ValidationException(String msg, List<String> errors)
20      {
21          super(msg);
22          this.errors = ImmutableList.copyOf(checkNotNull(errors));
23      }
24  
25      /**
26       * @return a list of the original errors
27       */
28      public List<String> getErrors()
29      {
30          return errors;
31      }
32  }