equal
deleted
inserted
replaced
66 |
66 |
67 public void setDatabases(List<DatabaseDefinition> databases) { |
67 public void setDatabases(List<DatabaseDefinition> databases) { |
68 this.databases = databases; |
68 this.databases = databases; |
69 } |
69 } |
70 |
70 |
71 public DatabaseDefinition getDatabase(String name) { |
71 /** |
72 return findByName(databases, name); |
72 * @throws ConfigurationException if no database with this name is configured |
|
73 */ |
|
74 public DatabaseDefinition getDatabase(String name) throws ConfigurationException { |
|
75 DatabaseDefinition dd = findByName(databases, name); |
|
76 if (dd == null) { |
|
77 throw new ConfigurationException("Database is not configured: " + name); |
|
78 } else { |
|
79 return dd; |
|
80 } |
73 } |
81 } |
74 |
82 |
75 @XmlElement(name = "formatter", namespace = CONFIGURATION) |
83 @XmlElement(name = "formatter", namespace = CONFIGURATION) |
76 public List<FormatterDefinition> getFormatters() { |
84 public List<FormatterDefinition> getFormatters() { |
77 return formatters; |
85 return formatters; |
83 |
91 |
84 /** |
92 /** |
85 * @param name name of desired formatter. Looking for this name in user configuration, then in |
93 * @param name name of desired formatter. Looking for this name in user configuration, then in |
86 * buil-in formatters. If null, default from configuration or (if not configured) built-in |
94 * buil-in formatters. If null, default from configuration or (if not configured) built-in |
87 * default is used. |
95 * default is used. |
88 * @return formatter definition or null if none for this name is found |
96 * @return formatter definition |
|
97 * @throws ConfigurationException if no formatter with this name was found |
89 */ |
98 */ |
90 public FormatterDefinition getFormatter(String name) { |
99 public FormatterDefinition getFormatter(String name) throws ConfigurationException { |
91 if (name == null) { |
100 if (name == null) { |
92 if (defaultFormatter == null) { |
101 return defaultFormatter == null ? getFormatter(DEFAULT_FORMATTER) : getFormatter(defaultFormatter); |
93 return getFormatter(DEFAULT_FORMATTER); |
|
94 } else { |
|
95 return getFormatter(defaultFormatter); |
|
96 } |
|
97 } else { |
102 } else { |
98 FormatterDefinition fd = findByName(formatters, name); |
103 FormatterDefinition fd = findByName(formatters, name); |
99 return fd == null ? findByName(buildInFormatters, name) : fd; |
104 fd = fd == null ? findByName(buildInFormatters, name) : fd; |
|
105 if (fd == null) { |
|
106 throw new ConfigurationException("Formatter is not configured: " + name); |
|
107 } else { |
|
108 return fd; |
|
109 } |
100 } |
110 } |
101 } |
111 } |
102 |
112 |
103 @XmlTransient |
113 @XmlTransient |
104 public Collection<FormatterDefinition> getBuildInFormatters() { |
114 public Collection<FormatterDefinition> getBuildInFormatters() { |