Project

General

Profile

Revision e5413aa3

IDe5413aa349f1951175fe202e1f8e743bb3213e2e
Parent b6c2dd01
Child 7f3f7703

Added by Patrick Plitzner over 3 years ago

Remove unneccesary casts

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/specimen/abcd206/in/Abcd206Import.java
282 282
     */
283 283
    @SuppressWarnings("rawtypes")
284 284
    private void handleSingleUnit(Abcd206ImportState state, Element item) {
285
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
285
        Abcd206ImportConfigurator config = state.getConfig();
286 286
        if (DEBUG) {
287 287
            logger.info("handleSingleUnit "+state.getRef());
288 288
        }
......
341 341
                    state.getDataHolder().gatheringElevationUnit, state.getDataHolder().gatheringDateText,
342 342
                    state.getDataHolder().gatheringNotes, state.getTransformer().getReferenceSystemByKey(
343 343
                            state.getDataHolder().gatheringSpatialDatum), state.getDataHolder().gatheringAgentList,
344
                    state.getDataHolder().gatheringTeamList, (Abcd206ImportConfigurator)state.getConfig());
344
                    state.getDataHolder().gatheringTeamList, state.getConfig());
345 345

  
346 346
            // country
347 347
            UnitsGatheringArea unitsGatheringArea = new UnitsGatheringArea();
348 348
            //  unitsGatheringArea.setConfig(state.getConfig(),getOccurrenceService(), getTermService());
349
            unitsGatheringArea.setParams(state.getDataHolder().isocountry, state.getDataHolder().country, ((Abcd206ImportConfigurator) state.getConfig()), cdmAppController.getTermService(), cdmAppController.getOccurrenceService());
349
            unitsGatheringArea.setParams(state.getDataHolder().isocountry, state.getDataHolder().country, (state.getConfig()), cdmAppController.getTermService(), cdmAppController.getOccurrenceService());
350 350

  
351 351
            DefinedTermBase<?> areaCountry =  unitsGatheringArea.getCountry();
352 352

  
353 353
            // other areas
354 354
            unitsGatheringArea = new UnitsGatheringArea();
355 355
            //            unitsGatheringArea.setConfig(state.getConfig(),getOccurrenceService(),getTermService());
356
            unitsGatheringArea.setAreas(state.getDataHolder().namedAreaList,((Abcd206ImportConfigurator) state.getConfig()), cdmAppController.getTermService(), cdmAppController.getVocabularyService());
356
            unitsGatheringArea.setAreas(state.getDataHolder().namedAreaList,(state.getConfig()), cdmAppController.getTermService(), cdmAppController.getVocabularyService());
357 357
            ArrayList<DefinedTermBase> nas = unitsGatheringArea.getAreas();
358 358
            for (DefinedTermBase namedArea : nas) {
359 359
                unitsGatheringEvent.addArea(namedArea);
......
545 545
    @Override
546 546
    protected void importAssociatedUnits(Abcd206ImportState state, Object itemObject, DerivedUnitFacade derivedUnitFacade) {
547 547

  
548
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator) state.getConfig();
548
        Abcd206ImportConfigurator config = state.getConfig();
549 549
        //import associated units
550 550
        FieldUnit currentFieldUnit = derivedUnitFacade.innerFieldUnit();
551 551
        //TODO: push state (think of implementing stack architecture for state
......
764 764
     * @param state
765 765
     */
766 766
    private void setCollectionData(Abcd206ImportState state, DerivedUnitFacade derivedUnitFacade) {
767
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
767
        Abcd206ImportConfigurator config = state.getConfig();
768 768
        SpecimenImportUtility.setUnitID(derivedUnitFacade.innerDerivedUnit(), state.getDataHolder().unitID, config);
769 769
        if(!config.isMapUnitIdToAccessionNumber()){
770 770
            derivedUnitFacade.setAccessionNumber(NB(state.getDataHolder().accessionNumber));
......
897 897
     * @return the Institution (existing or new)
898 898
     */
899 899
    private Institution getInstitution(String institutionCode, Abcd206ImportState state) {
900
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
900
        Abcd206ImportConfigurator config = state.getConfig();
901 901
        Institution institution=null;
902 902
        List<Institution> institutions;
903 903
        try {
......
938 938
     * @return the Collection (existing or new)
939 939
     */
940 940
    private Collection getCollection(Institution institution, String collectionCode, Abcd206ImportState state) {
941
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
941
        Abcd206ImportConfigurator config = state.getConfig();
942 942
        Collection collection = null;
943 943
        List<Collection> collections;
944 944
        try {
......
976 976
     */
977 977
    @SuppressWarnings("rawtypes")
978 978
    private void linkDeterminationEvent(Abcd206ImportState state, Taxon taxon, boolean preferredFlag,  DerivedUnitFacade derivedFacade) {
979
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
979
        Abcd206ImportConfigurator config = state.getConfig();
980 980
        if(DEBUG){
981 981
            logger.info("start linkdetermination with taxon:" + taxon.getUuid()+", "+taxon);
982 982
        }
......
1057 1057
     * @param determinationEvent:the determinationevent
1058 1058
     */
1059 1059
    private void makeIndividualsAssociation(Abcd206ImportState state, Taxon taxon, DeterminationEvent determinationEvent) {
1060
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
1060
        Abcd206ImportConfigurator config = state.getConfig();
1061 1061
        SpecimenUserInteraction sui = config.getSpecimenUserInteraction();
1062 1062

  
1063 1063
        if (DEBUG) {
......
1553 1553
     * @param derivedUnitFacade : the current derivedunitfacade
1554 1554
     */
1555 1555
    private void handleIdentifications(Abcd206ImportState state, DerivedUnitFacade derivedUnitFacade) {
1556
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
1556
        Abcd206ImportConfigurator config = state.getConfig();
1557 1557

  
1558 1558

  
1559 1559
        String scientificName = "";
......
1638 1638
     * @param state : the ABCD import state
1639 1639
     */
1640 1640
    private void addTaxonNode(Taxon taxon, Abcd206ImportState state, boolean preferredFlag) {
1641
        Abcd206ImportConfigurator config = (Abcd206ImportConfigurator)state.getConfig();
1641
        Abcd206ImportConfigurator config = state.getConfig();
1642 1642
        logger.info("link taxon to a taxonNode "+taxon.getTitleCache());
1643 1643
        //only add nodes if not already existing in current classification or default classification
1644 1644

  

Also available in: Unified diff

Add picture from clipboard (Maximum size: 40 MB)