Project

General

Profile

Download (1.04 KB) Statistics
| Branch: | Tag: | Revision:
1
/**
2
* Copyright (C) 2017 EDIT
3
* European Distributed Institute of Taxonomy
4
* http://www.e-taxonomy.eu
5
*
6
* The contents of this file are subject to the Mozilla Public License Version 1.1
7
* See LICENSE.TXT at the top of this package for the full license terms.
8
*/
9
package eu.etaxonomy.cdm.api.utility;
10

    
11
import org.springframework.beans.factory.annotation.Autowired;
12

    
13
import eu.etaxonomy.cdm.api.service.IOccurrenceService;
14
import eu.etaxonomy.cdm.model.occurrence.DerivedUnit;
15

    
16
/**
17
 * @author a.kohlbecker
18
 * @since Dec 14, 2017
19
 *
20
 */
21
public class DerivedUnitConverterFactory {
22

    
23
    private static IOccurrenceService service;
24

    
25
    @Autowired
26
    public void setIOccurrenceService(IOccurrenceService service){
27
        DerivedUnitConverterFactory.service = service;
28
    }
29

    
30
    public static <TARGET extends DerivedUnit> DerivedUnitConverter<TARGET> createDerivedUnitConverter(DerivedUnit derivedUnit, Class<TARGET> targetType){
31
        DerivedUnitConverter<TARGET> converter = new DerivedUnitConverter<TARGET>(derivedUnit, service);
32
        return converter;
33
    }
34

    
35

    
36
}
(3-3/7)