@Test public void 無効なFillingProviderでPropertyMatcherを作成しようとするとE$PROFILL$0001が発生する() { boolean called = false; try { profill.createPropertyMatcher(new FillingProvider() { @Override public Object provide(MatchedProperty property, Object bean) { return null; } }); } catch (InternalException ex) { assertThat(ex.getCode(), is("E-PROFILL#0001")); called = true; } assertThat(called, is(true)); }
protected PropertyMatcher createPropertyMatcher(FillingProvider provider) { ProvideFillingFor pff = provider.getClass().getAnnotation(ProvideFillingFor.class); if (pff == null) { throw new InternalException(Profill.class, "E-PROFILL#0001"); } return new PropertyMatcher(pff.annotation(), pff.name(), pff.type()); }
Profill { protected PropertyMatcher createPropertyMatcher(FillingProvider provider) { ProvideFillingFor pff = provider.getClass().getAnnotation(ProvideFillingFor.class); if (pff == null) { throw new InternalException(Profill.class, "E-PROFILL#0001"); } return new PropertyMatcher(pff.annotation(), pff.name(), pff.type()); } }
Profill { protected PropertyMatcher createPropertyMatcher(FillingProvider provider) { ProvideFillingFor pff = provider.getClass().getAnnotation(ProvideFillingFor.class); if (pff == null) { throw new InternalException(Profill.class, "E-PROFILL#0001"); } return new PropertyMatcher(pff.annotation(), pff.name(), pff.type()); } Profill(); }
Profill { protected PropertyMatcher createPropertyMatcher(FillingProvider provider) { ProvideFillingFor pff = provider.getClass().getAnnotation(ProvideFillingFor.class); if (pff == null) { throw new InternalException(Profill.class, "E-PROFILL#0001"); } return new PropertyMatcher(pff.annotation(), pff.name(), pff.type()); } Profill(); void makeSafeAgainstMultiThreadedAccess(); void addFillingProvider(FillingProvider provider); void fill(Object bean); boolean isTryToInstantiateIfNestedPropertyIsNull(); void setTryToInstantiateIfNestedPropertyIsNull(boolean value); }
Profill { protected PropertyMatcher createPropertyMatcher(FillingProvider provider) { ProvideFillingFor pff = provider.getClass().getAnnotation(ProvideFillingFor.class); if (pff == null) { throw new InternalException(Profill.class, "E-PROFILL#0001"); } return new PropertyMatcher(pff.annotation(), pff.name(), pff.type()); } Profill(); void makeSafeAgainstMultiThreadedAccess(); void addFillingProvider(FillingProvider provider); void fill(Object bean); boolean isTryToInstantiateIfNestedPropertyIsNull(); void setTryToInstantiateIfNestedPropertyIsNull(boolean value);  }