1 package net.sf.openrocket.preset;
3 import java.util.ArrayList;
6 public class InvalidComponentPresetException extends Exception {
8 private List<String> errors = new ArrayList<String>();
9 private List<TypedKey<?>> invalidParameters = new ArrayList<TypedKey<?>>();
11 public InvalidComponentPresetException() {
15 public InvalidComponentPresetException(String message, Throwable cause) {
16 super(message, cause);
19 public InvalidComponentPresetException(String message) {
23 public InvalidComponentPresetException(Throwable cause) {
27 void addInvalidParameter(TypedKey<?> key ) {
28 invalidParameters.add(key);
31 void addInvalidParameter(TypedKey<?> key, String message ) {
32 invalidParameters.add(key);
36 void addMessage( String message ) {
40 boolean hasProblems() {
41 return (invalidParameters.size() + errors.size()) > 0;
44 public int problemCount() {
45 return Math.max( invalidParameters.size(), errors.size() );
48 public List<String> getErrors() {
52 public List<TypedKey<?>> getInvalidParameters() {
53 return invalidParameters;