← Back to team overview

dhis2-devs team mailing list archive

[Branch ~dhis2-devs-core/dhis2/trunk] Rev 14007: added @Description annotation for BaseIdObject, BaseNameableObject

 

------------------------------------------------------------
revno: 14007
committer: Morten Olav Hansen <mortenoh@xxxxxxxxx>
branch nick: dhis2
timestamp: Thu 2014-02-13 14:59:41 +0700
message:
  added @Description annotation for BaseIdObject, BaseNameableObject
modified:
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java
  dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.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/common/BaseIdentifiableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2014-02-13 05:51:55 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseIdentifiableObject.java	2014-02-13 07:59:41 +0000
@@ -36,6 +36,7 @@
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
 import org.apache.commons.lang.Validate;
+import org.hisp.dhis.common.annotation.Description;
 import org.hisp.dhis.common.view.SharingBasicView;
 import org.hisp.dhis.common.view.SharingDetailedView;
 import org.hisp.dhis.common.view.SharingExportView;
@@ -180,6 +181,7 @@
 
     @JsonProperty( value = "id" )
     @JacksonXmlProperty( localName = "id", isAttribute = true )
+    @Description( "The Unique Identifier for this Object." )
     public String getUid()
     {
         return uid;
@@ -192,6 +194,7 @@
 
     @JsonProperty
     @JacksonXmlProperty( isAttribute = true )
+    @Description( "The unique code for this Object." )
     public String getCode()
     {
         return code;
@@ -204,6 +207,7 @@
 
     @JsonProperty
     @JacksonXmlProperty( isAttribute = true )
+    @Description( "The name of this Object. Required and unique." )
     public String getName()
     {
         return name;
@@ -228,6 +232,7 @@
 
     @JsonProperty
     @JacksonXmlProperty( isAttribute = true )
+    @Description( "The date this object was created." )
     public Date getCreated()
     {
         return created;
@@ -240,6 +245,7 @@
 
     @JsonProperty
     @JacksonXmlProperty( isAttribute = true )
+    @Description( "The date this object was last updated." )
     public Date getLastUpdated()
     {
         return lastUpdated;

=== modified file 'dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java	2013-09-16 17:07:25 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/BaseNameableObject.java	2014-02-13 07:59:41 +0000
@@ -32,6 +32,7 @@
 import com.fasterxml.jackson.annotation.JsonView;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlProperty;
 import com.fasterxml.jackson.dataformat.xml.annotation.JacksonXmlRootElement;
+import org.hisp.dhis.common.annotation.Description;
 import org.hisp.dhis.common.view.DetailedView;
 import org.hisp.dhis.common.view.ExportView;
 import org.hisp.dhis.common.view.ShortNameView;
@@ -39,7 +40,7 @@
 /**
  * @author Bob Jolliffe
  */
-@JacksonXmlRootElement(localName = "nameableObject", namespace = DxfNamespaces.DXF_2_0)
+@JacksonXmlRootElement( localName = "nameableObject", namespace = DxfNamespaces.DXF_2_0 )
 public class BaseNameableObject
     extends BaseIdentifiableObject
     implements NameableObject
@@ -83,7 +84,7 @@
         this.code = code;
         this.name = name;
     }
-    
+
     public BaseNameableObject( int id, String uid, String name, String shortName,
         String code, String description )
     {
@@ -117,12 +118,12 @@
         {
             return false;
         }
-        
+
         if ( !getClass().isAssignableFrom( o.getClass() ) )
         {
             return false;
         }
-        
+
         if ( !super.equals( o ) )
         {
             return false;
@@ -134,7 +135,7 @@
         {
             return false;
         }
-        
+
         if ( getDescription() != null ? !getDescription().equals( other.getDescription() ) : other.getDescription() != null )
         {
             return false;
@@ -144,8 +145,9 @@
     }
 
     @JsonProperty
-    @JsonView({ ShortNameView.class, DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(isAttribute = true)
+    @JsonView( { ShortNameView.class, DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( isAttribute = true )
+    @Description( "An short name representing this Object. Optional but unique." )
     public String getShortName()
     {
         return shortName;
@@ -157,8 +159,9 @@
     }
 
     @JsonProperty
-    @JsonView({ DetailedView.class, ExportView.class })
-    @JacksonXmlProperty(namespace = DxfNamespaces.DXF_2_0)
+    @JsonView( { DetailedView.class, ExportView.class } )
+    @JacksonXmlProperty( namespace = DxfNamespaces.DXF_2_0 )
+    @Description( "Description of this Object." )
     public String getDescription()
     {
         return description;
@@ -188,7 +191,7 @@
     {
         this.displayDescription = displayDescription;
     }
-    
+
     @Override
     public void mergeWith( IdentifiableObject other )
     {