You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 09:57:13 UTC
[sling-org-apache-sling-provisioning-model] 17/34: Rename some
constants
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.provisioning.model-1.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-provisioning-model.git
commit 380d68efca7cbbdd7103c0ea0be407d920e7dbec
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Tue Sep 30 14:00:19 2014 +0000
Rename some constants
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/tooling/support/slingstart-model@1628443 13f79535-47bb-0310-9956-ffa450edef68
---
.../apache/sling/provisioning/model/Feature.java | 9 ++++++++
.../sling/provisioning/model/ModelConstants.java | 27 ++++++++++++++--------
.../sling/provisioning/model/io/ModelReader.java | 2 +-
3 files changed, 28 insertions(+), 10 deletions(-)
diff --git a/src/main/java/org/apache/sling/provisioning/model/Feature.java b/src/main/java/org/apache/sling/provisioning/model/Feature.java
index 7ca9da6..0839703 100644
--- a/src/main/java/org/apache/sling/provisioning/model/Feature.java
+++ b/src/main/java/org/apache/sling/provisioning/model/Feature.java
@@ -87,6 +87,15 @@ public class Feature
}
/**
+ * Find the run mode if available
+ * @param runModes
+ * @return The feature or null.
+ */
+ public RunMode findRunMode(final String runMode) {
+ return this.findRunMode(new String[] {runMode});
+ }
+
+ /**
* Get or create the run mode.
* @param runModes The run modes.
* @return The feature for the given run modes.
diff --git a/src/main/java/org/apache/sling/provisioning/model/ModelConstants.java b/src/main/java/org/apache/sling/provisioning/model/ModelConstants.java
index 14bb646..db101f7 100644
--- a/src/main/java/org/apache/sling/provisioning/model/ModelConstants.java
+++ b/src/main/java/org/apache/sling/provisioning/model/ModelConstants.java
@@ -16,13 +16,28 @@
*/
package org.apache.sling.provisioning.model;
-
+/**
+ * Constants for the provisioning model.
+ */
public abstract class ModelConstants {
- /** Name of the configuration containing the web.xml. */
+ /** Name of Sling's launchpad feature. */
+ public static final String FEATURE_LAUNCHPAD = ":launchpad";
+
+ /** Name of the boot feature */
+ public static final String FEATURE_BOOT = ":boot";
+
+
+ /**
+ * Name of the configuration containing the web.xml. This configuration
+ * is used by the launchpad feature.
+ */
public static final String CFG_WEB_XML = ":web.xml";
- /** Name of the configuration for the bootstrap contents. */
+ /**
+ * Name of the configuration for the bootstrap contents. This
+ * configuration is used by the launchpad feature.
+ */
public static final String CFG_BOOTSTRAP = ":bootstrap";
/** Unprocessed configuration values. */
@@ -35,12 +50,6 @@ public abstract class ModelConstants {
public static final String CFG_FORMAT_PROPERTIES = "properties";
- /** Name of the base run mode for the Sling launchpad. */
- public static final String RUN_MODE_BASE = ":base";
-
- /** Name of the boot run mode. */
- public static final String RUN_MODE_BOOT = ":boot";
-
/** Name of the webapp run mode. */
public static final String RUN_MODE_WEBAPP = ":webapp";
diff --git a/src/main/java/org/apache/sling/provisioning/model/io/ModelReader.java b/src/main/java/org/apache/sling/provisioning/model/io/ModelReader.java
index 17a5b34..59fa682 100644
--- a/src/main/java/org/apache/sling/provisioning/model/io/ModelReader.java
+++ b/src/main/java/org/apache/sling/provisioning/model/io/ModelReader.java
@@ -195,7 +195,7 @@ public class ModelReader {
if ( !parameters.isEmpty() ) {
throw new IOException(exceptionPrefix + "Unknown global parameters in line " + this.lineNumberReader.getLineNumber() + ": " + line);
}
- if ( this.feature.findRunMode(null) != null ) {
+ if ( this.feature.findRunMode((String)null) != null ) {
throw new IOException(exceptionPrefix + "Duplicate global run mode in line " + this.lineNumberReader.getLineNumber() + ": " + line);
}
this.runMode = this.feature.getOrCreateFeature(null);
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.