@Test public final void testUnmarshal() { final HierarchicalStreamReader reader = mock(HierarchicalStreamReader.class); final UnmarshallingContext context = mock(UnmarshallingContext.class); when(context.getRequiredType()).thenReturn(DateTime.class); when(reader.getValue()).thenReturn("1970-01-01T01:00:00.000+01:00"); final Object result = testee.unmarshal(reader, context); assertThat(result).isEqualTo(new DateTime(0)); }
@Override @SuppressWarnings("unchecked") public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) { try { final Class requiredType = context.getRequiredType(); final Constructor constructor = requiredType.getConstructor(Object.class); return constructor.newInstance(reader.getValue()); } catch (final Exception e) { throw new SerializationException(String.format( "An exception occurred while deserializing a Joda Time object: %s", context .getRequiredType().getSimpleName()), e); } }
JodaTimeConverter implements Converter { @Override @SuppressWarnings("unchecked") public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) { try { final Class requiredType = context.getRequiredType(); final Constructor constructor = requiredType.getConstructor(Object.class); return constructor.newInstance(reader.getValue()); } catch (final Exception e) { throw new SerializationException(String.format( "An exception occurred while deserializing a Joda Time object: %s", context .getRequiredType().getSimpleName()), e); } } }
JodaTimeConverter implements Converter { @Override @SuppressWarnings("unchecked") public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) { try { final Class requiredType = context.getRequiredType(); final Constructor constructor = requiredType.getConstructor(Object.class); return constructor.newInstance(reader.getValue()); } catch (final Exception e) { throw new SerializationException(String.format( "An exception occurred while deserializing a Joda Time object: %s", context .getRequiredType().getSimpleName()), e); } }  }
JodaTimeConverter implements Converter { @Override @SuppressWarnings("unchecked") public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) { try { final Class requiredType = context.getRequiredType(); final Constructor constructor = requiredType.getConstructor(Object.class); return constructor.newInstance(reader.getValue()); } catch (final Exception e) { throw new SerializationException(String.format( "An exception occurred while deserializing a Joda Time object: %s", context .getRequiredType().getSimpleName()), e); } }  @Override @SuppressWarnings("unchecked") boolean canConvert(final Class type); @Override void marshal(final Object source, final HierarchicalStreamWriter writer,
	        final MarshallingContext context); @Override @SuppressWarnings("unchecked") Object unmarshal(final HierarchicalStreamReader reader,
	        final UnmarshallingContext context); }
JodaTimeConverter implements Converter { @Override @SuppressWarnings("unchecked") public Object unmarshal(final HierarchicalStreamReader reader, final UnmarshallingContext context) { try { final Class requiredType = context.getRequiredType(); final Constructor constructor = requiredType.getConstructor(Object.class); return constructor.newInstance(reader.getValue()); } catch (final Exception e) { throw new SerializationException(String.format( "An exception occurred while deserializing a Joda Time object: %s", context .getRequiredType().getSimpleName()), e); } }  @Override @SuppressWarnings("unchecked") boolean canConvert(final Class type); @Override void marshal(final Object source, final HierarchicalStreamWriter writer,
	        final MarshallingContext context); @Override @SuppressWarnings("unchecked") Object unmarshal(final HierarchicalStreamReader reader,
	        final UnmarshallingContext context);  }