*/
package org.sonar.api.batch.debt;
-import javax.annotation.CheckForNull;
-
import java.util.List;
+import javax.annotation.CheckForNull;
/**
* This class can be used to retrieve characteristics or sub-characteristics from the technical debt model during analysis.
*
* Unfortunately, this class cannot be used to set characteristic on {@link org.sonar.api.measures.Measure},
- * because the Measure API still uses deprecated {@link org.sonar.api.technicaldebt.batch.Characteristic}.
+ * because the Measure API still uses deprecated {@code org.sonar.api.technicaldebt.batch.Characteristic}.
*
* @since 4.3
* @deprecated since 5.1 debt model will soon be unavailable on batch side
*/
package org.sonar.api.batch.events;
-import org.sonar.api.batch.Initializer;
-
import java.util.List;
+import org.sonar.api.batch.Initializer;
/**
* @since 3.7
}
/**
- * Called before and after execution of all {@link Initializers}s.
+ * Called before and after execution of all {@link Initializer}s.
*/
void onInitializersPhase(InitializersPhaseEvent event);
* public void compute(MeasureComputerContext context) {
* int ncloc = context.getMeasure("ncloc");
* List<Issue> issues = context.getIssues();
- * if (ncloc != null && !issues.isEmpty()) {
+ * if (ncloc != null && !issues.isEmpty()) {
* double value = issues.size() / ncloc;
* context.addMeasure("my_new_metric", value);
* }
/**
* Return the formatted datetime.
- * <br>
- * Example : formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22T19:10:03+0100")) -> Jan 22, 2014 7:10 PM
+ * <p>
+ * Example: {@code formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22T19:10:03+0100"))}
+ * returns {@code "Jan 22, 2014 7:10 PM"}.
+ * </p>
*
* @since 4.2
*/
/**
* Return the formatted date.
* <br>
- * Example : formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22")) -> Jan 22, 2014
+ * Example: {@code formatDateTime(Locale.ENGLISH, DateUtils.parseDateTime("2014-01-22"))}
+ * returns {@code "Jan 22, 2014"}.
*
* @since 4.2
*/
/**
* Return the formatted decimal, with always one fraction digit.
* <br>
- * Example : formatDouble(Locale.FRENCH, 10.56) -> 10,6
+ * Example: {@code formatDouble(Locale.FRENCH, 10.56)} returns {@code "10,6"}.
*
* @since 4.4
*/
/**
* Return the formatted integer.
* <br>
- * Example : formatInteger(Locale.ENGLISH, 100000) -> 100,000
+ * Example: {@code formatInteger(Locale.ENGLISH, 100000)} returns {@code "100,000"}.
*
* @since 4.4
*/
boolean isFreshInstall();
/**
- * The database version before the server startup. Returns <=0 if db created from scratch.
+ * The database version before the server startup. Returns a non-zero negative value if db created from scratch.
*/
int getInitialDbVersion();
* Entry-point to define a new Identity provider.
* Only one of this two interfaces can be used :
* <ul>
- * <li>{@link OAuth2IdentityProvider}</li> for OAuth2 authentication
- * <li>{@link BaseIdentityProvider}</li> for other kind of authentication
+ * <li>{@link OAuth2IdentityProvider} for OAuth2 authentication</li>
+ * <li>{@link BaseIdentityProvider} for other kind of authentication</li>
* </ul>
*
* @since 5.4
* depends on situation:
* <ul>
* <li>${SONAR_HOME}/temp on server side</li>
- * <li>${SONAR_HOME}/.sonartmp<rnd> on the batch side</li>
+ * <li>${SONAR_HOME}/.sonartmp on scanner side</li>
* </ul>
* @since 4.0
*
*/
package org.sonar.api.utils;
-import org.apache.commons.io.IOUtils;
-import org.sonar.api.utils.log.Logger;
-import org.sonar.api.utils.log.Loggers;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import javax.annotation.Nullable;
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
import java.io.BufferedReader;
import java.io.ByteArrayInputStream;
import java.io.File;
import java.util.Map;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
+import javax.annotation.Nullable;
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+import org.apache.commons.io.IOUtils;
+import org.sonar.api.utils.log.Logger;
+import org.sonar.api.utils.log.Loggers;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
/**
* XML Parsing tool using XPATH. It's recommended to use StaxParser when parsing big XML files.
/**
* Fix the error occured when parsing a string containing unicode character
- * Example : &u20ac; will be replaced by €
+ * Example : {@code &u20ac;} will be replaced by {@code €}
*/
protected String fixUnicodeChar(String text) {
String unicode = "&u";
*/
package org.sonar.api.utils.text;
-import org.sonar.api.utils.DateUtils;
-
-import javax.annotation.Nullable;
import java.io.Writer;
import java.util.Date;
import java.util.Map;
+import javax.annotation.Nullable;
+import org.sonar.api.utils.DateUtils;
/**
* Writes JSON as a stream. This class allows plugins to not directly depend
* <ul>
* <li>primitive types: String, Number, Boolean</li>
* <li>java.util.Date: encoded as datetime (see {@link #valueDateTime(java.util.Date)}</li>
- * <li><code>Map<Object, Object></code>. Method toString is called for the key.</li>
+ * <li>{@code Map<Object, Object>}. Method toString is called for the key.</li>
* <li>Iterable</li>
* </ul>
*
*
* <p>Example of template:
<pre>
- <% content_for :script do %>
- <script>alert('page loaded')</script>
- <% end %>
+ <% content_for :script do %>
+ <script>alert('page loaded')</script>
+ <% end %>
- <% content_for :footer do %>
- <div>this is <b>my footer</b></div>
-<% end %>
+ <% content_for :footer do %>
+ <div>this is <b>my footer</b></div>
+<% end %>
</pre>
*
* @since 3.3
/**
* Interface to create a web service by implementing a Ruby On Rails controller.
* The method getTemplate() return the ROR controller code, the name of the controller class defined in the template
- * MUST match the following name scheme : Api::$Webservice.getId()Controller I.E : Webservice.getId() = TestWS > Api::TestWSController.
+ * MUST match the following name scheme : Api::$Webservice.getId()Controller I.E : Webservice.getId() = TestWS > Api::TestWSController.
* The plugin will be deployed with the following URL scheme: http://sonarhost/api/plugins/$Webservice.getId()/:action/:id
* :action is the name of the controller method to call, :id is a param that will be passed to the controller, these 2 params are not mandatory
* and will call the index controller method if not specified.
boolean optional() default true;
/**
- * @since 3.3 Options for property of type WidgetPropertyType.METRIC</code>.
+ * @since 3.3 Options for property of type {@link WidgetPropertyType#METRIC}.
*
* If no option is specified, any metric will match.
* If options are specified, all must match for the metric to be displayed.
* For example <code>type:INT,FLOAT</code> will match any metric of type <code>INT</code> or <code>FLOAT</code>.
* For example <code>type:NUMERIC</code> will match any metric of numerictype.
*
- * @since 3.5 Options for property of type WidgetPropertyType.SINGLE_SELECT_LIST</code>
+ * @since 3.5 Options for property of type {@link WidgetPropertyType#SINGLE_SELECT_LIST}.
* For example {"property_1", "property_3", "property_3"}).
*
*/