This is an automated email from the ASF dual-hosted git repository.
sseifert pushed a commit to branch master
in repository
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-models-api.git
The following commit(s) were added to refs/heads/master by this push:
new 22d7795 SLING-11595 - Fix injectionStrategy Javadocs
new ee6260f Merge pull request #7 from karollewandowski/master
22d7795 is described below
commit 22d77955a6c2651c7980882ce12a9fba2ace348c
Author: Karol Lewandowski <[email protected]>
AuthorDate: Sun Sep 25 20:16:08 2022 +0200
SLING-11595 - Fix injectionStrategy Javadocs
---
.../annotations/injectorspecific/ChildResource.java | 14 +++++++++-----
.../annotations/injectorspecific/OSGiService.java | 15 ++++++++++-----
.../injectorspecific/RequestAttribute.java | 13 +++++++++----
.../annotations/injectorspecific/ResourcePath.java | 15 ++++++++++-----
.../annotations/injectorspecific/ScriptVariable.java | 13 +++++++++----
.../models/annotations/injectorspecific/Self.java | 19 ++++++++++++-------
.../annotations/injectorspecific/SlingObject.java | 15 ++++++++++-----
.../annotations/injectorspecific/ValueMapValue.java | 13 +++++++++----
8 files changed, 78 insertions(+), 39 deletions(-)
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ChildResource.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ChildResource.java
index afc38fe..b37e7da 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ChildResource.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ChildResource.java
@@ -53,11 +53,15 @@ public @interface ChildResource {
public boolean optional() default false;
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
- * @return Injection strategy
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
public InjectionStrategy injectionStrategy() default
InjectionStrategy.DEFAULT;
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/OSGiService.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/OSGiService.java
index f4dc54f..cb80d8d 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/OSGiService.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/OSGiService.java
@@ -38,7 +38,7 @@ import
org.apache.sling.models.spi.injectorspecific.InjectAnnotation;
public @interface OSGiService {
/**
* specifies the RFC 1960-based filter string, which is evaluated when
retrieving the service. If empty string or left out, then no filtering is being
performed.
- *
+ *
* @see "Core Specification, section 5.5, for a description of the filter
string"
* @see <a href="http://www.ietf.org/rfc/rfc1960.txt">RFC 1960</a>
*/
@@ -53,10 +53,15 @@ public @interface OSGiService {
public boolean optional() default false;
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
public InjectionStrategy injectionStrategy() default
InjectionStrategy.DEFAULT;
}
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/RequestAttribute.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/RequestAttribute.java
index 4c45822..1567dd6 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/RequestAttribute.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/RequestAttribute.java
@@ -54,10 +54,15 @@ public @interface RequestAttribute {
public boolean optional() default false;
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
public InjectionStrategy injectionStrategy() default
InjectionStrategy.DEFAULT;
}
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ResourcePath.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ResourcePath.java
index 2a4421b..fb7cc0d 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ResourcePath.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ResourcePath.java
@@ -41,7 +41,7 @@ public @interface ResourcePath {
* Specifies the path of the resource. If not provided, the path is
derived from the property name.
*/
public String path() default "";
-
+
/**
* Specifies more than one path for the resource. If not provided, a
single path is derived from the property name.
*/
@@ -63,10 +63,15 @@ public @interface ResourcePath {
public boolean optional() default false;
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
public InjectionStrategy injectionStrategy() default
InjectionStrategy.DEFAULT;
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ScriptVariable.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ScriptVariable.java
index ae918a6..93a96a7 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ScriptVariable.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ScriptVariable.java
@@ -53,10 +53,15 @@ public @interface ScriptVariable {
public boolean optional() default false;
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
public InjectionStrategy injectionStrategy() default
InjectionStrategy.DEFAULT;
}
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/Self.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/Self.java
index 76292e0..945457f 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/Self.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/Self.java
@@ -29,7 +29,7 @@ import
org.apache.sling.models.spi.injectorspecific.InjectAnnotation;
/**
* Annotation to be used on either methods, fields or constructor parameters
to let Sling Models
- * inject the adaptable itself, or an object that can be adapted from it.
+ * inject the adaptable itself, or an object that can be adapted from it.
*/
@Target({ METHOD, FIELD, PARAMETER })
@Retention(RUNTIME)
@@ -38,18 +38,23 @@ import
org.apache.sling.models.spi.injectorspecific.InjectAnnotation;
public @interface Self {
/**
- * If set to true, the model can be instantiated even if there is no
object that can be adapted from the adaptable itself.
+ * If set to true, the model can be instantiated even if there is no
object that can be adapted from the adaptable itself.
* Default = false.
* @deprecated Use {@link #injectionStrategy} instead
*/
@Deprecated
public boolean optional() default false;
-
+
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
public InjectionStrategy injectionStrategy() default
InjectionStrategy.DEFAULT;
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/SlingObject.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/SlingObject.java
index 22edd5c..2a1409d 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/SlingObject.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/SlingObject.java
@@ -91,12 +91,17 @@ public @interface SlingObject {
*/
@Deprecated
boolean optional() default false;
-
+
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
public InjectionStrategy injectionStrategy() default
InjectionStrategy.DEFAULT;
diff --git
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.java
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.java
index b332101..3495bf0 100644
---
a/src/main/java/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.java
+++
b/src/main/java/org/apache/sling/models/annotations/injectorspecific/ValueMapValue.java
@@ -53,10 +53,15 @@ public @interface ValueMapValue {
boolean optional() default false;
/**
- * if set to REQUIRED injection is mandatory, if set to OPTIONAL injection
is optional, in case of DEFAULT
- * the standard annotations ({@link
org.apache.sling.models.annotations.Optional}, {@link
org.apache.sling.models.annotations.Required}) are used.
- * If even those are not available the default injection strategy defined
on the {@link org.apache.sling.models.annotations.Model} applies.
- * Default value = DEFAULT.
+ * Specifies the injection strategy applied to an annotated element:
+ * <ul>
+ * <li>If set to {@link InjectionStrategy#REQUIRED}, injection is
mandatory.</li>
+ * <li>If set to {@link InjectionStrategy#OPTIONAL}, injection is
optional.</li>
+ * <li>If set to {@link InjectionStrategy#DEFAULT} (default), the default
injection strategy defined on the
+ * {@link org.apache.sling.models.annotations.Model} applies.</li>
+ * </ul>
+ * WARNING: Injection strategy is ignored if either {@link
org.apache.sling.models.annotations.Optional}
+ * or {@link org.apache.sling.models.annotations.Required} is applied on
the same element.
*/
InjectionStrategy injectionStrategy() default InjectionStrategy.DEFAULT;