diff options
author | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2015-04-02 12:37:15 +0200 |
---|---|---|
committer | Jean-Baptiste Lievremont <jean-baptiste.lievremont@sonarsource.com> | 2015-04-03 09:17:48 +0200 |
commit | ff8100df10e8dd17e32c8f3771a53f6b96448589 (patch) | |
tree | b86e588ec2ae719990af719908f28159f6bce616 /sonar-plugin-api | |
parent | de2529f3d48fabe51c469da08035595c3b907b45 (diff) | |
download | sonarqube-ff8100df10e8dd17e32c8f3771a53f6b96448589.tar.gz sonarqube-ff8100df10e8dd17e32c8f3771a53f6b96448589.zip |
Pull define(...) method into a dedicated interface
Diffstat (limited to 'sonar-plugin-api')
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Definable.java | 25 | ||||
-rw-r--r-- | sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java | 8 |
2 files changed, 27 insertions, 6 deletions
diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Definable.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Definable.java new file mode 100644 index 00000000000..335b3d6fab0 --- /dev/null +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/Definable.java @@ -0,0 +1,25 @@ +/* + * SonarQube, open source software quality management tool. + * Copyright (C) 2008-2014 SonarSource + * mailto:contact AT sonarsource DOT com + * + * SonarQube is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * SonarQube is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +package org.sonar.api.server.ws; + +public interface Definable<T> { + + void define(T context); +} diff --git a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java index faa0f05fb56..20e7c97fae4 100644 --- a/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java +++ b/sonar-plugin-api/src/main/java/org/sonar/api/server/ws/WebService.java @@ -35,11 +35,7 @@ import javax.annotation.concurrent.Immutable; import java.io.IOException; import java.net.URL; -import java.util.Arrays; -import java.util.Collection; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; /** * Defines a web service. Note that contrary to the deprecated {@link org.sonar.api.web.Webservice} @@ -100,7 +96,7 @@ import java.util.Set; * * @since 4.2 */ -public interface WebService extends ServerExtension { +public interface WebService extends ServerExtension, Definable<WebService.Context> { class Context { private final Map<String, Controller> controllers = Maps.newHashMap(); |