1717import java .io .IOException ;
1818import java .util .Date ;
1919
20+ import tools .jackson .core .JacksonException ;
2021import tools .jackson .core .Version ;
22+ import tools .jackson .core .exc .JacksonIOException ;
2123import tools .jackson .core .type .TypeReference ;
22-
2324import tools .jackson .databind .JavaType ;
2425import tools .jackson .databind .ObjectMapper ;
2526import tools .jackson .databind .cfg .MapperBuilder ;
2627import tools .jackson .databind .cfg .MapperBuilderState ;
2728import tools .jackson .databind .deser .DeserializationContextExt ;
2829import tools .jackson .databind .module .SimpleModule ;
2930import tools .jackson .databind .ser .SerializationContextExt ;
30-
3131import tools .jackson .dataformat .ion .ionvalue .IonValueModule ;
3232
3333import com .amazon .ion .IonDatagram ;
@@ -335,7 +335,7 @@ public IonGenerator createGenerator(IonWriter out) {
335335 * Note: method does not close the underlying reader
336336 */
337337 @ SuppressWarnings ("unchecked" )
338- public <T > T readValue (IonReader r , Class <T > valueType ) throws IOException {
338+ public <T > T readValue (IonReader r , Class <T > valueType ) throws JacksonException {
339339 DeserializationContextExt ctxt = _deserializationContext ();
340340 return (T )_readMapAndClose (ctxt , tokenStreamFactory ().createParser (ctxt , r ),
341341 _typeFactory .constructType (valueType ));
@@ -348,7 +348,7 @@ public <T> T readValue(IonReader r, Class<T> valueType) throws IOException {
348348 * Note: method does not close the underlying reader
349349 */
350350 @ SuppressWarnings ({ "unchecked" , "rawtypes" })
351- public <T > T readValue (IonReader r , TypeReference valueTypeRef ) throws IOException {
351+ public <T > T readValue (IonReader r , TypeReference valueTypeRef ) throws JacksonException {
352352 DeserializationContextExt ctxt = _deserializationContext ();
353353 return (T )_readMapAndClose (ctxt , tokenStreamFactory ().createParser (ctxt , r ),
354354 _typeFactory .constructType (valueTypeRef ));
@@ -361,7 +361,7 @@ public <T> T readValue(IonReader r, TypeReference valueTypeRef) throws IOExcepti
361361 * Note: method does not close the underlying reader
362362 */
363363 @ SuppressWarnings ("unchecked" )
364- public <T > T readValue (IonReader r , JavaType valueType ) throws IOException {
364+ public <T > T readValue (IonReader r , JavaType valueType ) throws JacksonException {
365365 DeserializationContextExt ctxt = _deserializationContext ();
366366 return (T )_readMapAndClose (ctxt , tokenStreamFactory ().createParser (ctxt , r ), valueType );
367367 }
@@ -370,7 +370,7 @@ public <T> T readValue(IonReader r, JavaType valueType) throws IOException {
370370 * Convenience method for converting Ion value into given value type.
371371 */
372372 @ SuppressWarnings ("unchecked" )
373- public <T > T readValue (IonValue value , Class <T > valueType ) throws IOException {
373+ public <T > T readValue (IonValue value , Class <T > valueType ) throws JacksonException {
374374 if (value == null ) {
375375 return null ;
376376 }
@@ -383,7 +383,7 @@ public <T> T readValue(IonValue value, Class<T> valueType) throws IOException {
383383 * Convenience method for converting Ion value into given value type.
384384 */
385385 @ SuppressWarnings ({ "unchecked" , "rawtypes" })
386- public <T > T readValue (IonValue value , TypeReference valueTypeRef ) throws IOException {
386+ public <T > T readValue (IonValue value , TypeReference valueTypeRef ) throws JacksonException {
387387 if (value == null ) {
388388 return null ;
389389 }
@@ -396,7 +396,7 @@ public <T> T readValue(IonValue value, TypeReference valueTypeRef) throws IOExce
396396 * Convenience method for converting Ion value into given value type.
397397 */
398398 @ SuppressWarnings ("unchecked" )
399- public <T > T readValue (IonValue value , JavaType valueType ) throws IOException {
399+ public <T > T readValue (IonValue value , JavaType valueType ) throws JacksonException {
400400 if (value == null ) {
401401 return null ;
402402 }
@@ -410,7 +410,7 @@ public <T> T readValue(IonValue value, JavaType valueType) throws IOException {
410410 *<p>
411411 * Note: method does not close the underlying writer explicitly
412412 */
413- public void writeValue (IonWriter w , Object value ) throws IOException {
413+ public void writeValue (IonWriter w , Object value ) throws JacksonException {
414414 SerializationContextExt prov = _serializationContext ();
415415 _configAndWriteValue (prov ,
416416 tokenStreamFactory ().createGenerator (prov , w ), value );
@@ -419,7 +419,7 @@ public void writeValue(IonWriter w, Object value) throws IOException {
419419 /**
420420 * Method that can be used to map any Java value to an IonValue.
421421 */
422- public IonValue writeValueAsIonValue (Object value ) throws IOException
422+ public IonValue writeValueAsIonValue (Object value ) throws JacksonException
423423 {
424424 // 04-Jan-2017, tatu: Bit of incompatiblity wrt 2.x handling: should this result in
425425 // Java `null`, or Ion null marker? For now, choose latter
@@ -436,6 +436,8 @@ public IonValue writeValueAsIonValue(Object value) throws IOException
436436 IonValue result = container .get (0 );
437437 result .removeFromContainer ();
438438 return result ;
439+ } catch (IOException e ) {
440+ throw JacksonIOException .construct (e );
439441 }
440442 }
441443
0 commit comments