← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 15715: minor updates to Node annotations

 

------------------------------------------------------------
revno: 15715
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Tue 2014-06-17 11:21:14 +0200
message:
  minor updates to Node annotations
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeCollection.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeComplex.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeRoot.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeSimple.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java


--
lp:dhis2
https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk

Your team DHIS 2 developers is subscribed to branch lp:dhis2.
To unsubscribe from this branch go to https://code.launchpad.net/~dhis2-devs-core/dhis2/trunk/+edit-subscription
=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeCollection.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeCollection.java	2014-06-15 11:00:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeCollection.java	2014-06-17 09:21:14 +0000
@@ -53,5 +53,9 @@
 
     boolean isPersisted() default true;
 
-    boolean owner() default false;
+    boolean isOwner() default false;
+
+    boolean isWritable() default true;
+
+    boolean isReadable() default true;
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeComplex.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeComplex.java	2014-06-15 11:00:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeComplex.java	2014-06-17 09:21:14 +0000
@@ -47,5 +47,9 @@
 
     boolean isPersisted() default true;
 
-    boolean owner() default false;
+    boolean isOwner() default false;
+
+    boolean isWritable() default true;
+
+    boolean isReadable() default true;
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeRoot.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeRoot.java	2014-06-09 14:26:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeRoot.java	2014-06-17 09:21:14 +0000
@@ -44,4 +44,10 @@
     String value() default "";
 
     String namespace() default "";
+
+    boolean isPersisted() default true;
+
+    boolean isWritable() default true;
+
+    boolean isReadable() default true;
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeSimple.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeSimple.java	2014-06-09 14:26:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/node/annotation/NodeSimple.java	2014-06-17 09:21:14 +0000
@@ -43,9 +43,13 @@
 {
     String value() default "";
 
+    String namespace() default "";
+
     boolean isAttribute() default false;
 
     boolean isPersisted() default true;
 
-    String namespace() default "";
+    boolean isWritable() default true;
+
+    boolean isReadable() default true;
 }

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java	2014-06-15 11:00:20 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/schema/Property.java	2014-06-17 09:21:14 +0000
@@ -37,6 +37,7 @@
 import org.hisp.dhis.common.NameableObject;
 import org.hisp.dhis.node.annotation.NodeRoot;
 import org.hisp.dhis.node.annotation.NodeSimple;
+import org.springframework.core.Ordered;
 
 import java.lang.reflect.Method;
 
@@ -44,19 +45,19 @@
  * @author Morten Olav Hansen <mortenoh@xxxxxxxxx>
  */
 @JacksonXmlRootElement( localName = "property", namespace = DxfNamespaces.DXF_2_0 )
-@NodeRoot
-public class Property
+@NodeRoot( isWritable = false, isPersisted = false )
+public class Property implements Ordered
 {
     /**
      * Class for property.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private Class<?> klass;
 
     /**
      * If this property is a collection, this is the class of the items inside the collection.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private Class<?> itemKlass;
 
     /**
@@ -73,32 +74,32 @@
      * Name for this property, if this class is a collection, it is the name of the items -inside- the collection
      * and not the collection wrapper itself.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private String name;
 
     /**
      * Name for actual field, used to persistence operations and getting setter/getter.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private String fieldName;
 
     /**
      * Is this property persisted somewhere. This property will be used to create criteria queries
      * on demand (default: true)
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean persisted = true;
 
     /**
      * Name of collection wrapper.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private String collectionName;
 
     /**
      * If this Property is a collection, should it be wrapped with collectionName?
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean collectionWrapping;
 
     /**
@@ -106,19 +107,19 @@
      *
      * @see org.hisp.dhis.common.annotation.Description
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private String description;
 
     /**
      * Namespace used for this property.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private String namespace;
 
     /**
      * Usually only used for XML. Is this property considered an attribute.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean attribute;
 
     /**
@@ -127,7 +128,7 @@
      * of the collection, e.g. List<String> would set simple to be true, but List<DataElement> would set it
      * to false.
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean simple;
 
     /**
@@ -135,14 +136,14 @@
      *
      * @see java.util.Collection
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean collection;
 
     /**
      * If this property is a complex object or a collection, is this property considered
      * the owner of that relationship (important for imports etc).
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean owner;
 
     /**
@@ -150,7 +151,7 @@
      *
      * @see org.hisp.dhis.common.IdentifiableObject
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean identifiableObject;
 
     /**
@@ -158,7 +159,7 @@
      *
      * @see org.hisp.dhis.common.NameableObject
      */
-    @NodeSimple( isPersisted = false )
+    @NodeSimple
     private boolean nameableObject;
 
     public Property()
@@ -375,6 +376,12 @@
     }
 
     @Override
+    public int getOrder()
+    {
+        return HIGHEST_PRECEDENCE;
+    }
+
+    @Override
     public int hashCode()
     {
         return Objects.hashCode( klass, itemKlass, getterMethod, name, fieldName, persisted, collectionName, description,