Skip to content

Commit 7b0913f

Browse files
committed
Improve javadocs wrt #555
1 parent 3eb74af commit 7b0913f

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

src/main/java/com/fasterxml/jackson/databind/ObjectMapper.java

+11-3
Original file line numberDiff line numberDiff line change
@@ -2055,7 +2055,8 @@ public <T extends JsonNode> T valueToTree(Object fromValue)
20552055
*<p>
20562056
* NOTE: since this method does NOT throw exceptions, but internal
20572057
* processing may, caller usually has little information as to why
2058-
* serialization would fail.
2058+
* serialization would fail. If you want access to internal {@link Exception},
2059+
* call {@link #canSerialize(Class, AtomicReference)} instead.
20592060
*
20602061
* @return True if mapper can find a serializer for instances of
20612062
* given class (potentially serializable), false otherwise (not
@@ -2079,8 +2080,15 @@ public boolean canSerialize(Class<?> type, AtomicReference<Throwable> cause) {
20792080
/**
20802081
* Method that can be called to check whether mapper thinks
20812082
* it could deserialize an Object of given type.
2082-
* Check is done
2083-
* by checking whether a deserializer can be found for the type.
2083+
* Check is done by checking whether a registered deserializer can
2084+
* be found or built for the type; if not (either by no mapping being
2085+
* found, or through an <code>Exception</code> being thrown, false
2086+
* is returned.
2087+
*<p>
2088+
* <b>NOTE</b>: in case an exception is thrown during course of trying
2089+
* co construct matching deserializer, it will be effectively swallowed.
2090+
* If you want access to that exception, call
2091+
* {@link #canDeserialize(JavaType, AtomicReference) instead.
20842092
*
20852093
* @return True if mapper can find a serializer for instances of
20862094
* given class (potentially serializable), false otherwise (not

0 commit comments

Comments
 (0)