You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ra...@apache.org on 2015/08/14 21:07:48 UTC
[15/50] [abbrv] qpid-proton git commit: Modified the CodecHelper to
handle Encodable types when passed into encodeObject method.
Modified the CodecHelper to handle Encodable types when passed into encodeObject method.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/67aba850
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/67aba850
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/67aba850
Branch: refs/heads/rajith-codec
Commit: 67aba850565f2721b9ebdd873891402b69af50a0
Parents: 9114e13
Author: Rajith Attapattu <ra...@apache.org>
Authored: Fri Feb 20 20:39:10 2015 -0500
Committer: Rajith Attapattu <ra...@apache.org>
Committed: Thu Jul 9 09:12:38 2015 -0400
----------------------------------------------------------------------
.../java/org/apache/qpid/proton/codec2/CodecHelper.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/67aba850/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
----------------------------------------------------------------------
diff --git a/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java b/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
index 235d445..9be9b68 100644
--- a/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
+++ b/proton-j/src/main/java/org/apache/qpid/proton/codec2/CodecHelper.java
@@ -78,7 +78,7 @@ public class CodecHelper
}
encoder.end();
}
-
+
public static void encodeMapWithKeyAsSymbol(Encoder encoder, Map<String, Object> map)
{
if (map == null)
@@ -94,7 +94,7 @@ public class CodecHelper
}
encoder.end();
}
-
+
public static void encodeList(Encoder encoder, List<Object> list)
{
if (list == null)
@@ -117,6 +117,10 @@ public class CodecHelper
{
encoder.putNull();
}
+ else if (o instanceof Encodable)
+ {
+ ((Encodable) o).encode(encoder);
+ }
else if (o.getClass().isPrimitive())
{
if (o instanceof Byte)
@@ -281,4 +285,4 @@ public class CodecHelper
throw new IllegalArgumentException("Do not know how to write Objects of class " + o.getClass().getName());
}
}
-}
+}
\ No newline at end of file
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org