@Test public void testReverseIllegalAccessException() throws Exception { SimpleBaseDomain source = new SimpleBaseDomain(); when(reflectionHelper.newInstance(any(Class.class))).thenThrow(new IllegalAccessException()); exception.expect(JTransfoException.class); exception.expectMessage("Cannot create instance of transfer object class org.jtransfo.object.SimpleBaseTo."); typeConverter.reverse(source, toField, null); }
@Override public Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags) throws JTransfoException { if (List.class.isAssignableFrom(toField.getType())) { return rodListTypeConverter.reverse((List<?>) domainObject, toField, toObject, tags); } if (Set.class.isAssignableFrom(toField.getType())) { return rodSetTypeConverter.reverse((Set<?>) domainObject, toField, toObject, tags); } return super.reverse(domainObject, toField, toObject, tags); }
ReadOnlyDomainAutomaticTypeConverter extends AbstractToDomainTypeConverter implements Named, NeedsJTransfo { @Override public Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags) throws JTransfoException { if (List.class.isAssignableFrom(toField.getType())) { return rodListTypeConverter.reverse((List<?>) domainObject, toField, toObject, tags); } if (Set.class.isAssignableFrom(toField.getType())) { return rodSetTypeConverter.reverse((Set<?>) domainObject, toField, toObject, tags); } return super.reverse(domainObject, toField, toObject, tags); } }
ReadOnlyDomainAutomaticTypeConverter extends AbstractToDomainTypeConverter implements Named, NeedsJTransfo { @Override public Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags) throws JTransfoException { if (List.class.isAssignableFrom(toField.getType())) { return rodListTypeConverter.reverse((List<?>) domainObject, toField, toObject, tags); } if (Set.class.isAssignableFrom(toField.getType())) { return rodSetTypeConverter.reverse((Set<?>) domainObject, toField, toObject, tags); } return super.reverse(domainObject, toField, toObject, tags); }  }
ReadOnlyDomainAutomaticTypeConverter extends AbstractToDomainTypeConverter implements Named, NeedsJTransfo { @Override public Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags) throws JTransfoException { if (List.class.isAssignableFrom(toField.getType())) { return rodListTypeConverter.reverse((List<?>) domainObject, toField, toObject, tags); } if (Set.class.isAssignableFrom(toField.getType())) { return rodSetTypeConverter.reverse((Set<?>) domainObject, toField, toObject, tags); } return super.reverse(domainObject, toField, toObject, tags); }  @Override void setJTransfo(JTransfo jTransfo); @Override boolean canConvert(Type realToType, Type realDomainType); @Override Object convert(Object toObject, SyntheticField domainField, Object domainObject, String... tags); @Override Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags); @Override Object doConvert(JTransfo jTransfo, Object toObject, SyntheticField domainField, String... tags); @Override String getName(); void setName(String name); void setKeepNullList(boolean keepNullList); void setKeepNullSet(boolean keepNullSet); void setAlwaysNewList(boolean alwaysNewList); void setAlwaysNewSet(boolean alwaysNewSet); void setSortList(boolean sortList); }
ReadOnlyDomainAutomaticTypeConverter extends AbstractToDomainTypeConverter implements Named, NeedsJTransfo { @Override public Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags) throws JTransfoException { if (List.class.isAssignableFrom(toField.getType())) { return rodListTypeConverter.reverse((List<?>) domainObject, toField, toObject, tags); } if (Set.class.isAssignableFrom(toField.getType())) { return rodSetTypeConverter.reverse((Set<?>) domainObject, toField, toObject, tags); } return super.reverse(domainObject, toField, toObject, tags); }  @Override void setJTransfo(JTransfo jTransfo); @Override boolean canConvert(Type realToType, Type realDomainType); @Override Object convert(Object toObject, SyntheticField domainField, Object domainObject, String... tags); @Override Object reverse(Object domainObject, SyntheticField toField, Object toObject, String... tags); @Override Object doConvert(JTransfo jTransfo, Object toObject, SyntheticField domainField, String... tags); @Override String getName(); void setName(String name); void setKeepNullList(boolean keepNullList); void setKeepNullSet(boolean keepNullSet); void setAlwaysNewList(boolean alwaysNewList); void setAlwaysNewSet(boolean alwaysNewSet); void setSortList(boolean sortList);  }