------------------------------------------------------------
revno: 10358
committer: Lars Helge Ă˜verland <[email protected]>
branch nick: dhis2
timestamp: Wed 2013-03-20 16:38:07 +0100
message:
JacksonMapListIdentifiableObjectSerializer, null checks
modified:
dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/JacksonMapListIdentifiableObjectSerializer.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/adapter/JacksonMapListIdentifiableObjectSerializer.java'
--- dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/JacksonMapListIdentifiableObjectSerializer.java 2013-03-10 12:29:03 +0000
+++ dhis-2/dhis-api/src/main/java/org/hisp/dhis/common/adapter/JacksonMapListIdentifiableObjectSerializer.java 2013-03-20 15:38:07 +0000
@@ -58,9 +58,22 @@
for ( IdentifiableObject object : value.get( key ) )
{
jgen.writeStartObject();
- jgen.writeStringField( "id", object.getUid() );
- jgen.writeStringField( "name", object.getName() );
- jgen.writeStringField( "code", object.getCode() );
+
+ if ( object.getUid() != null )
+ {
+ jgen.writeStringField( "id", object.getUid() );
+ }
+
+ if ( object.getName() != null )
+ {
+ jgen.writeStringField( "name", object.getName() );
+ }
+
+ if ( object.getCode() != null )
+ {
+ jgen.writeStringField( "code", object.getCode() );
+ }
+
jgen.writeEndObject();
}
_______________________________________________
Mailing list: https://launchpad.net/~dhis2-devs
Post to : [email protected]
Unsubscribe : https://launchpad.net/~dhis2-devs
More help : https://help.launchpad.net/ListHelp