You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2020/03/13 07:29:19 UTC

[sling-org-apache-sling-servlets-annotations] 01/02: SLING-9055 use meta annotation for property sling.servlet.paths-strict

This is an automated email from the ASF dual-hosted git repository.

kwin pushed a commit to branch feature/paths-strict-metaannotation
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-servlets-annotations.git

commit af30df2cc035d1c3d69bc66c9ab58247471f6b1e
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Mar 13 08:25:28 2020 +0100

    SLING-9055 use meta annotation for property sling.servlet.paths-strict
---
 .../annotations/SlingServletPathsStrict.java       |  8 +-----
 .../annotations/SlingServletPaths_Strict.java      | 29 ++++++++++++++++++++++
 2 files changed, 30 insertions(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
index 9cae955..be4a968 100644
--- a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
+++ b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPathsStrict.java
@@ -42,6 +42,7 @@ import org.osgi.service.component.annotations.ComponentPropertyType;
     version="1.1")
 
 @ComponentPropertyType
+@SlingServletPaths_Strict
 public @interface SlingServletPathsStrict {
     /**
      * Prefix for every property being generated from the annotations elements (as defined in OSGi 7 Compendium, 112.8.2.1)
@@ -64,13 +65,6 @@ public @interface SlingServletPathsStrict {
      */
     String[] paths();
 
-    /** Activate the strict resolution mode. Must be set to true
-     *  (which is the default) for the other options besides "paths"
-     *  to be taken into account.
-     * @return the "strict" option value
-     */
-    boolean paths_strict() default true;
-
     /**
      * One or more request URL selectors supported by the servlet. If specified,
      * all selectors must match for the servlet to be selected.
diff --git a/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths_Strict.java b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths_Strict.java
new file mode 100644
index 0000000..1579718
--- /dev/null
+++ b/src/main/java/org/apache/sling/servlets/annotations/SlingServletPaths_Strict.java
@@ -0,0 +1,29 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.sling.servlets.annotations;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Target;
+
+/**
+ * Marker meta-annotation to activate the strict resolution mode. 
+ * Only supposed to be used on the {@link SlingServletPathsStrict} to set the property correctly without allowing to modify it
+ */
+@Target(ElementType.ANNOTATION_TYPE)
+@interface SlingServletPaths_Strict {
+
+}