@@ -17,7 +17,7 @@ | |||
* 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.charts; | |||
package org.sonar.plugins.core.charts; | |||
import org.apache.commons.io.FileUtils; | |||
import org.jfree.chart.ChartUtilities; |
@@ -20,7 +20,6 @@ | |||
package org.sonar.plugins.core.charts; | |||
import org.junit.Test; | |||
import org.sonar.api.charts.AbstractChartTest; | |||
import org.sonar.api.charts.ChartParameters; | |||
import java.awt.image.BufferedImage; |
@@ -20,7 +20,6 @@ | |||
package org.sonar.plugins.core.charts; | |||
import org.junit.Test; | |||
import org.sonar.api.charts.AbstractChartTest; | |||
import org.sonar.api.charts.ChartParameters; | |||
import java.awt.image.BufferedImage; |
@@ -20,7 +20,6 @@ | |||
package org.sonar.plugins.core.charts; | |||
import org.junit.Test; | |||
import org.sonar.api.charts.AbstractChartTest; | |||
import org.sonar.api.charts.ChartParameters; | |||
import java.awt.image.BufferedImage; |
@@ -24,6 +24,17 @@ | |||
<artifactId>sonar-plugin-api</artifactId> | |||
<scope>provided</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-io</groupId> | |||
<artifactId>commons-io</artifactId> | |||
<scope>provided</scope> | |||
</dependency> | |||
<dependency> | |||
<groupId>commons-lang</groupId> | |||
<artifactId>commons-lang</artifactId> | |||
<scope>provided</scope> | |||
</dependency> | |||
<!-- unit testing --> | |||
<dependency> |
@@ -14,6 +14,10 @@ | |||
<groupId>${project.groupId}</groupId> | |||
<artifactId>sonar-plugin-api</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>jfree</groupId> | |||
<artifactId>jfreechart</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.apache.maven</groupId> | |||
<artifactId>maven-project</artifactId> | |||
@@ -24,6 +28,7 @@ | |||
<scope>provided</scope> | |||
</dependency> | |||
<!-- unit test --> | |||
<dependency> | |||
<groupId>junit</groupId> |
@@ -30,10 +30,12 @@ import java.awt.Color; | |||
import java.awt.image.BufferedImage; | |||
/** | |||
* An extension point to generate JFreeChart charts | |||
* Base implementation to generate charts with JFreechart | |||
* | |||
* @since 1.10 | |||
* @deprecated in 4.5.1, replaced by Javascript charts | |||
*/ | |||
@Deprecated | |||
public abstract class AbstractChart implements Chart { | |||
public static final int FONT_SIZE = 13; |
@@ -24,10 +24,12 @@ import org.sonar.api.ServerExtension; | |||
import java.awt.image.BufferedImage; | |||
/** | |||
* An Extension to create charts | |||
* Extension point to generate charts | |||
* | |||
* @since 1.10 | |||
* @deprecated in 4.5.1, replaced by Javascript charts | |||
*/ | |||
@Deprecated | |||
public interface Chart extends ServerExtension { | |||
String getKey(); | |||
@@ -33,7 +33,9 @@ import java.util.Map; | |||
/** | |||
* The class to hold parameters to configure a chart | |||
* @since 1.10 | |||
* @deprecated in 4.5.1, replaced by Javascript charts | |||
*/ | |||
@Deprecated | |||
public class ChartParameters { | |||
private static final String[] EMPTY = new String[0]; | |||
@@ -17,6 +17,9 @@ | |||
* along with this program; if not, write to the Free Software Foundation, | |||
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | |||
*/ | |||
/** | |||
* Deprecated in 4.5.1. JFreechart charts are replaced by Javascript charts. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.api.charts; | |||
@@ -19,11 +19,12 @@ | |||
*/ | |||
package org.sonar.api.charts; | |||
import static org.junit.Assert.*; | |||
import org.junit.Test; | |||
import java.util.Locale; | |||
import static org.junit.Assert.*; | |||
public class ChartParametersTest { | |||
@Test | |||
public void shouldForbidHighSizeForSecurityReasons() { |
@@ -84,10 +84,6 @@ | |||
<groupId>commons-codec</groupId> | |||
<artifactId>commons-codec</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>jfree</groupId> | |||
<artifactId>jfreechart</artifactId> | |||
</dependency> | |||
<dependency> | |||
<groupId>org.slf4j</groupId> | |||
<artifactId>slf4j-api</artifactId> |
@@ -20,8 +20,20 @@ | |||
package org.sonar.api; | |||
/** | |||
* Dependency Injection : all the classes implementing this interface are available in the batch IoC container. | |||
* Just add a parameter to the constructor of your component. | |||
* Marker interface for all the components available in container of batch (code analyzer). Note that | |||
* injection of dependencies by constructor is used : | |||
* <pre> | |||
* public class Foo implements BatchComponent { | |||
* | |||
* } | |||
* public class Bar implements BatchComponent { | |||
* private final Foo foo; | |||
* public Bar(Foo f) { | |||
* this.foo = f; | |||
* } | |||
* } | |||
* | |||
* </pre> | |||
* | |||
* @since 2.2 | |||
*/ |
@@ -20,7 +20,8 @@ | |||
package org.sonar.api; | |||
/** | |||
* Batch extension point. | |||
* Marker interface for all the batch extension points, which are aimed to be implemented | |||
* by plugins. | |||
* | |||
* @since 1.10 | |||
*/ |
@@ -20,8 +20,7 @@ | |||
package org.sonar.api; | |||
/** | |||
* CoreProperties is used to group various properties of Sonar as well | |||
* as default values of configuration in a single place | |||
* Non-exhaustive list of constants of core properties. | |||
* | |||
* @since 1.11 | |||
*/ |
@@ -20,7 +20,7 @@ | |||
package org.sonar.api; | |||
/** | |||
* Extension point. | |||
* Plugin extension point | |||
* | |||
* @since 1.10 | |||
*/ |
@@ -22,10 +22,11 @@ package org.sonar.api; | |||
import java.util.List; | |||
/** | |||
* A plugin is a group of extensions. See <code>org.sonar.api.Extension</code> interface to get all extension points. | |||
* A plugin is a group of extensions. See <code>org.sonar.api.Extension</code> interface to browse | |||
* available extension points. | |||
* <p/> | |||
* <p>The manifest property <code>Plugin-Class</code> must declare the name of the implementation class. | |||
* See META-INF/MANIFEST.MF.</p> | |||
* It is automatically set by sonar-packaging-maven-plugin when building plugins.</p> | |||
* | |||
* @see org.sonar.api.Extension | |||
* @since 1.10 |
@@ -24,6 +24,11 @@ import java.lang.annotation.RetentionPolicy; | |||
/** | |||
* Plugin properties. This annotation is only used on classes implementing org.sonar.api.Plugin. | |||
* <p/> | |||
* Note that {@link org.sonar.api.config.PropertyDefinition} is an alternative, programmatic and recommended approach | |||
* to declare properties. | |||
* <p/> | |||
* Effective property values are accessible at runtime through the component {@link org.sonar.api.config.Settings} | |||
* | |||
* @since 1.10 | |||
*/ |
@@ -28,18 +28,11 @@ import java.lang.annotation.Target; | |||
* Property value can be set in different ways : | |||
* <ul> | |||
* <li>System property</li> | |||
* <li>Maven command-line (-Dfoo=bar)</li> | |||
* <li>Batch command-line (-Dfoo=bar in Maven or sonar-runner)</li> | |||
* <li>Maven pom.xml (element <properties>)</li> | |||
* <li>Maven settings.xml</li> | |||
* <li>Sonar web interface</li> | |||
* <li>SonarQube web administration console</li> | |||
* </ul> | |||
* <p/> | |||
* Value is accessible in batch extensions via the Configuration object of class <code>org.sonar.api.resources.Project</code> | |||
* (see method <code>getConfiguration()</code>). | |||
* <p/> | |||
* <p><strong>Must be used in <code>org.sonar.api.Plugin</code> classes only.</strong></p> | |||
* <p></p> | |||
* It's recommended to use the class {@link org.sonar.api.config.PropertyDefinition} since v3.6. | |||
* | |||
* @since 1.10 | |||
*/ |
@@ -20,8 +20,7 @@ | |||
package org.sonar.api; | |||
/** | |||
* Dependency Injection : all the classes implementing this interface are available in the server IoC container. | |||
* Just add a parameter to the constructor of your component. | |||
* Same than {@link org.sonar.api.BatchComponent} but for server-side components. | |||
* | |||
* @since 2.2 | |||
*/ |
@@ -20,7 +20,10 @@ | |||
package org.sonar.api; | |||
/** | |||
* A plugin is a group of extensions. See {@link Extension} interface to get all extension points. | |||
* Plugin entry-point used to declare its extensions (see {@link org.sonar.api.Extension}. | |||
* <p/> | |||
* <p>The JAR manifest must declare the name of the implementation class in the property <code>Plugin-Class</code>. | |||
* This property is automatically set by sonar-packaging-maven-plugin when building plugin.</p> | |||
* | |||
* @since 2.8 | |||
*/ |
@@ -17,7 +17,7 @@ | |||
* 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.config.internal; | |||
package org.sonar.api.config; | |||
import org.apache.commons.lang.StringUtils; | |||
@@ -26,29 +26,29 @@ import java.util.Locale; | |||
/** | |||
* @since 3.7 | |||
*/ | |||
public class Category { | |||
class Category { | |||
private final String originalKey; | |||
private final boolean special; | |||
public Category(String originalKey) { | |||
Category(String originalKey) { | |||
this(originalKey, false); | |||
} | |||
public Category(String originalKey, boolean special) { | |||
Category(String originalKey, boolean special) { | |||
this.originalKey = originalKey; | |||
this.special = special; | |||
} | |||
public String originalKey() { | |||
String originalKey() { | |||
return originalKey; | |||
} | |||
public String key() { | |||
String key() { | |||
return StringUtils.lowerCase(originalKey, Locale.ENGLISH); | |||
} | |||
public boolean isSpecial() { | |||
boolean isSpecial() { | |||
return special; | |||
} | |||
@@ -24,8 +24,6 @@ import com.google.common.collect.Maps; | |||
import org.apache.commons.lang.StringUtils; | |||
import org.sonar.api.*; | |||
import org.sonar.api.Properties; | |||
import org.sonar.api.config.internal.Category; | |||
import org.sonar.api.config.internal.SubCategory; | |||
import org.sonar.api.utils.AnnotationUtils; | |||
import javax.annotation.Nullable; |
@@ -39,7 +39,7 @@ import java.util.Map; | |||
import java.util.Properties; | |||
/** | |||
* Project Settings on batch side, Global Settings on server side. This component does not access to database, so | |||
* Project settings on batch side, or global settings on server side. This component does not access to database, so | |||
* property changed via setter methods are not persisted. | |||
* <p/> | |||
* <p> |
@@ -17,19 +17,18 @@ | |||
* 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.config.internal; | |||
package org.sonar.api.config; | |||
/** | |||
* @since 3.7 | |||
*/ | |||
public class SubCategory extends Category { | |||
class SubCategory extends Category { | |||
public SubCategory(String originalKey) { | |||
SubCategory(String originalKey) { | |||
super(originalKey); | |||
} | |||
public SubCategory(String originalKey, boolean special) { | |||
SubCategory(String originalKey, boolean special) { | |||
super(originalKey, special); | |||
} | |||
@@ -1,23 +0,0 @@ | |||
/* | |||
* 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. | |||
*/ | |||
@ParametersAreNonnullByDefault | |||
package org.sonar.api.config.internal; | |||
import javax.annotation.ParametersAreNonnullByDefault; |
@@ -36,7 +36,6 @@ import java.security.Key; | |||
import static org.hamcrest.Matchers.greaterThan; | |||
import static org.hamcrest.Matchers.instanceOf; | |||
import static org.hamcrest.core.Is.is; | |||
import static org.hamcrest.core.Is.isA; | |||
import static org.junit.Assert.assertThat; | |||
import static org.junit.Assert.fail; | |||
@@ -17,7 +17,7 @@ | |||
* 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.config.internal; | |||
package org.sonar.api.config; | |||
import org.junit.Test; | |||
@@ -22,8 +22,6 @@ package org.sonar.api.config; | |||
import org.junit.Test; | |||
import org.sonar.api.Properties; | |||
import org.sonar.api.Property; | |||
import org.sonar.api.config.internal.Category; | |||
import org.sonar.api.config.internal.SubCategory; | |||
import org.sonar.api.resources.Qualifiers; | |||
import java.util.Arrays; |