PageRenderTime 253ms CodeModel.GetById 88ms app.highlight 4ms RepoModel.GetById 137ms app.codeStats 0ms

/src/main/java/com/t11e/discovery/datatool/column/ItemPropertiesFromColumnProcessor.java

http://github.com/t11e/discovery_datatool
Java | 28 lines | 24 code | 4 blank | 0 comment | 2 complexity | 8e448b1ea319a68141b211bec7c42c07 MD5 | raw file
 1package com.t11e.discovery.datatool.column;
 2
 3import java.sql.ResultSet;
 4import java.sql.SQLException;
 5import java.util.Map;
 6
 7public class ItemPropertiesFromColumnProcessor
 8  implements IItemPropertiesFromColumnProcessor
 9{
10  private final IColumnProcessor delegate;
11
12  public ItemPropertiesFromColumnProcessor(final IColumnProcessor delegate)
13  {
14    this.delegate = delegate;
15  }
16
17  @Override
18  public void processColumn(final Map<String, Object> target, final ResultSet rs, final int column,
19    final String propertyName)
20    throws SQLException
21  {
22    final Object value = delegate.processColumn(rs, column);
23    if (value != null)
24    {
25      target.put(propertyName, value);
26    }
27  }
28}