(Object[] row)
| 569 | } |
| 570 | |
| 571 | private final void fields0(Object[] row) { |
| 572 | Field<?>[] f = new Field[row.length]; |
| 573 | |
| 574 | // [#5145] When loading arrays, or when CSV headers are ignored, |
| 575 | // the source is still null at this stage. |
| 576 | if (source == null) |
| 577 | if (fieldsCorresponding) |
| 578 | throw new LoaderConfigurationException("Using fieldsCorresponding() requires field names to be available in source."); |
| 579 | else |
| 580 | source = Tools.fields(row.length); |
| 581 | |
| 582 | if (fieldMapper != null) |
| 583 | for (int i = 0; i < row.length; i++) { |
| 584 | final int index = i; |
| 585 | |
| 586 | f[i] = fieldMapper.map(new LoaderFieldContext() { |
| 587 | @Override |
| 588 | public int index() { |
| 589 | return index; |
| 590 | } |
| 591 | |
| 592 | @Override |
| 593 | public Field<?> field() { |
| 594 | return source[index]; |
| 595 | } |
| 596 | }); |
| 597 | } |
| 598 | |
| 599 | else if (fieldsCorresponding) |
| 600 | for (int i = 0; i < row.length; i++) { |
| 601 | f[i] = table.field(source[i]); |
| 602 | if (f[i] == null) |
| 603 | log.info("No column in target table " + table + " found for input field " + source[i]); |
| 604 | } |
| 605 | |
| 606 | fields(f); |
| 607 | } |
| 608 | |
| 609 | @Override |
| 610 | public final LoaderImpl<R> ignoreRows(int number) { |
no test coverage detected