You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2020/10/08 15:22:57 UTC
[sling-org-apache-sling-feature-analyser] branch master updated:
Add javadoc to Analyser
This is an automated email from the ASF dual-hosted git repository.
cziegeler pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-analyser.git
The following commit(s) were added to refs/heads/master by this push:
new 5e9708c Add javadoc to Analyser
5e9708c is described below
commit 5e9708cdcaa292ea6c9f87157bb0eb5ded48a799
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Thu Oct 8 17:22:18 2020 +0200
Add javadoc to Analyser
---
.../apache/sling/feature/analyser/Analyser.java | 67 ++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/src/main/java/org/apache/sling/feature/analyser/Analyser.java b/src/main/java/org/apache/sling/feature/analyser/Analyser.java
index d14c33e..19d7692 100644
--- a/src/main/java/org/apache/sling/feature/analyser/Analyser.java
+++ b/src/main/java/org/apache/sling/feature/analyser/Analyser.java
@@ -55,11 +55,24 @@ public class Analyser {
private final Map<String, Map<String,String>> configurations;
+ /**
+ * Create new analyser with a provided scanner and the tasks to run
+ * @param scanner The scanner
+ * @param tasks The tasks to run
+ * @throws IOException If setting up the analyser fails
+ */
public Analyser(final Scanner scanner,
final AnalyserTask...tasks) throws IOException {
this(scanner, Collections.emptyMap(), tasks);
}
+ /**
+ * Create a new analyser with a provided scanner, tasks and configurations
+ * @param scanner The scanner
+ * @param configurations The configurations for the tasks
+ * @param tasks The tasks
+ * @throws IOException If setting up the analyser fails
+ */
public Analyser(final Scanner scanner,
final Map<String, Map<String,String>> configurations,
final AnalyserTask...tasks) throws IOException {
@@ -68,12 +81,25 @@ public class Analyser {
this.scanner = scanner;
}
+ /**
+ * Create a new analyser with the provided scanner and task class names
+ * @param scanner The scanner
+ * @param taskClassNames The task class names
+ * @throws IOException If setting up the analyser fails
+ */
public Analyser(final Scanner scanner,
final String... taskClassNames)
throws IOException {
this(scanner, Collections.emptyMap(), taskClassNames);
}
+ /**
+ * Create a new analyser with a provided scanner, task class names and configurations
+ * @param scanner The scanner
+ * @param configurations The configurations for the tasks
+ * @param taskClassNames The task class names
+ * @throws IOException If setting up the analyser fails
+ */
public Analyser(final Scanner scanner,
final Map<String, Map<String,String>> configurations,
final String... taskClassNames)
@@ -84,12 +110,27 @@ public class Analyser {
}
}
+ /**
+ * Create a new analyser with a provided scanner and includes/excludes for the task ids
+ * @param scanner The scanner
+ * @param includes The includes for the task ids
+ * @param excludes The excludes for the task ids
+ * @throws IOException If setting up the analyser fails
+ */
public Analyser(final Scanner scanner,
final Set<String> includes,
final Set<String> excludes) throws IOException {
this(scanner, Collections.emptyMap(), includes, excludes);
}
+ /**
+ * Create a new analyser with a provided scanner and includes/excludes for the task ids and configuration
+ * @param scanner The scanner
+ * @param configurations The configurations for the tasks
+ * @param includes The includes for the task ids
+ * @param excludes The excludes for the task ids
+ * @throws IOException If setting up the analyser fails
+ */
public Analyser(final Scanner scanner,
final Map<String, Map<String,String>> configurations,
final Set<String> includes,
@@ -97,18 +138,44 @@ public class Analyser {
this(scanner, configurations, getTasksByIds(includes, excludes));
}
+ /**
+ * Create a new analyser with the provided scanner and use all available tasks
+ * @param scanner The scanner
+ * @throws IOException If setting up the analyser fails
+ */
public Analyser(final Scanner scanner) throws IOException {
this(scanner, getTasks());
}
+ /**
+ * Analyse the feature
+ * @param feature The feature to analyse
+ * @return The analyser result
+ * @throws Exception If analysing fails
+ */
public AnalyserResult analyse(final Feature feature) throws Exception {
return this.analyse(feature, null);
}
+ /**
+ * Analyse the feature using the provided framework artifact
+ * @param feature The feature to analyse
+ * @param fwk The OSGi framework artifact
+ * @return The analyser result
+ * @throws Exception If analysing fails
+ */
public AnalyserResult analyse(final Feature feature, final ArtifactId fwk) throws Exception {
return analyse(feature, fwk, null);
}
+ /**
+ * Analyse the feature using the provided framework artifact
+ * @param feature The feature to analyse
+ * @param fwk The OSGi framework artifact
+ * @param featureProvider Optional provider to resolve features (if required)
+ * @return The analyser result
+ * @throws Exception If analysing fails
+ */
public AnalyserResult analyse(final Feature feature, final ArtifactId fwk,
final FeatureProvider featureProvider) throws Exception {
logger.info("Starting analyzing feature '{}'...", feature.getId());