@Test(expected = IllegalArgumentException.class) public void testHandlingOfNullFactoryInMapping() { new FieldValueMappingCallback(this.model, this.resource, this.factory, this.annotatedFieldMappers, this.placeholderVariableResolvers).doWith(null); }
final void doWith(final MappedFieldMetaData metaData) { if (metaData == null) { throw new IllegalArgumentException("Method argument metaData must not be null."); } final FieldData fieldData = new FieldData(metaData, evaluateFieldPath(metaData)); final boolean isMappable = isMappable(fieldData); if (metaData.isLazy()) { Lazy<Object> lazy = isMappable ? new LazyFieldValue(fieldData, this) : LazyFieldValue.EMPTY; setField(metaData, lazy); return; } Object value = null; if (isMappable) { value = resolve(fieldData); } value = postProcessResolvedValue(fieldData, value); if (value != null) { setField(metaData, value); } }
FieldValueMappingCallback { final void doWith(final MappedFieldMetaData metaData) { if (metaData == null) { throw new IllegalArgumentException("Method argument metaData must not be null."); } final FieldData fieldData = new FieldData(metaData, evaluateFieldPath(metaData)); final boolean isMappable = isMappable(fieldData); if (metaData.isLazy()) { Lazy<Object> lazy = isMappable ? new LazyFieldValue(fieldData, this) : LazyFieldValue.EMPTY; setField(metaData, lazy); return; } Object value = null; if (isMappable) { value = resolve(fieldData); } value = postProcessResolvedValue(fieldData, value); if (value != null) { setField(metaData, value); } } }
FieldValueMappingCallback { final void doWith(final MappedFieldMetaData metaData) { if (metaData == null) { throw new IllegalArgumentException("Method argument metaData must not be null."); } final FieldData fieldData = new FieldData(metaData, evaluateFieldPath(metaData)); final boolean isMappable = isMappable(fieldData); if (metaData.isLazy()) { Lazy<Object> lazy = isMappable ? new LazyFieldValue(fieldData, this) : LazyFieldValue.EMPTY; setField(metaData, lazy); return; } Object value = null; if (isMappable) { value = resolve(fieldData); } value = postProcessResolvedValue(fieldData, value); if (value != null) { setField(metaData, value); } } FieldValueMappingCallback(
            Object model,
            Resource resource,
            ResourceModelFactory factory,
            AnnotatedFieldMappers mappers,
            PlaceholderVariableResolvers resolvers); }
FieldValueMappingCallback { final void doWith(final MappedFieldMetaData metaData) { if (metaData == null) { throw new IllegalArgumentException("Method argument metaData must not be null."); } final FieldData fieldData = new FieldData(metaData, evaluateFieldPath(metaData)); final boolean isMappable = isMappable(fieldData); if (metaData.isLazy()) { Lazy<Object> lazy = isMappable ? new LazyFieldValue(fieldData, this) : LazyFieldValue.EMPTY; setField(metaData, lazy); return; } Object value = null; if (isMappable) { value = resolve(fieldData); } value = postProcessResolvedValue(fieldData, value); if (value != null) { setField(metaData, value); } } FieldValueMappingCallback(
            Object model,
            Resource resource,
            ResourceModelFactory factory,
            AnnotatedFieldMappers mappers,
            PlaceholderVariableResolvers resolvers);  }
FieldValueMappingCallback { final void doWith(final MappedFieldMetaData metaData) { if (metaData == null) { throw new IllegalArgumentException("Method argument metaData must not be null."); } final FieldData fieldData = new FieldData(metaData, evaluateFieldPath(metaData)); final boolean isMappable = isMappable(fieldData); if (metaData.isLazy()) { Lazy<Object> lazy = isMappable ? new LazyFieldValue(fieldData, this) : LazyFieldValue.EMPTY; setField(metaData, lazy); return; } Object value = null; if (isMappable) { value = resolve(fieldData); } value = postProcessResolvedValue(fieldData, value); if (value != null) { setField(metaData, value); } } FieldValueMappingCallback(
            Object model,
            Resource resource,
            ResourceModelFactory factory,
            AnnotatedFieldMappers mappers,
            PlaceholderVariableResolvers resolvers);   }