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:19:48 UTC
[sling-org-apache-sling-caconfig-spi] 17/23: SLING-6374
Context-Aware Config: Allow to control property order in annotation classes
This is an automated email from the ASF dual-hosted git repository.
rombert pushed a commit to annotated tag org.apache.sling.caconfig.spi-1.2.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-caconfig-spi.git
commit 73f2c4c295c37d2a1af4e0c6b0624e10b9f9cda4
Author: Stefan Seifert <ss...@apache.org>
AuthorDate: Wed Dec 7 21:36:09 2016 +0000
SLING-6374 Context-Aware Config: Allow to control property order in annotation classes
git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/contrib/extensions/contextaware-config/spi@1773149 13f79535-47bb-0310-9956-ffa450edef68
---
.../sling/caconfig/spi/metadata/PropertyMetadata.java | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
diff --git a/src/main/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadata.java b/src/main/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadata.java
index 977e259..b2e56d0 100644
--- a/src/main/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadata.java
+++ b/src/main/java/org/apache/sling/caconfig/spi/metadata/PropertyMetadata.java
@@ -53,6 +53,7 @@ public final class PropertyMetadata<T> extends AbstractMetadata<PropertyMetadata
private final Class<T> type;
private T defaultValue;
private ConfigurationMetadata configurationMetadata;
+ private int order;
/**
* @param name Property name
@@ -151,6 +152,22 @@ public final class PropertyMetadata<T> extends AbstractMetadata<PropertyMetadata
}
/**
+ * @return Number to control property order in configuration editor.
+ */
+ public int getOrder() {
+ return order;
+ }
+
+ /**
+ * @param value Number to control property order in configuration editor.
+ * @return this
+ */
+ public PropertyMetadata<T> order(int value) {
+ this.order = value;
+ return this;
+ }
+
+ /**
* @return Metadata for nested configuration
*/
public ConfigurationMetadata getConfigurationMetadata() {
@@ -174,7 +191,7 @@ public final class PropertyMetadata<T> extends AbstractMetadata<PropertyMetadata
return configurationMetadata != null
&& (this.type.equals(ConfigurationMetadata.class) || this.type.equals(ConfigurationMetadata[].class));
}
-
+
@Override
public String toString() {
return getName() + "[" + this.type.getSimpleName() + "]";
--
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <co...@sling.apache.org>.