Project

General

Profile

« Previous | Next » 

Revision 51171c9d

Added by Andreas Müller over 12 years ago

last updates for Taxon Excel Import and moving all success variables to state

View differences:

cdmlib-io/src/main/java/eu/etaxonomy/cdm/io/excel/common/ExcelTaxonOrSpecimenImportBase.java
38 38

  
39 39

  
40 40
	protected static final String CDM_UUID_COLUMN = "(?i)(CdmUuid)";
41

  
41
	protected static final String IGNORE_COLUMN = "(?i)(Ignore|Not)";
42
	
42 43
	
43 44
	protected static final String RANK_COLUMN = "(?i)(Rank)";
44 45
	protected static final String FULL_NAME_COLUMN = "(?i)(FullName)";
......
48 49
	protected static final String INFRASPECIFIC_EPITHET_COLUMN = "(?i)(InfraSpecificEpi(thet)?)";
49 50

  
50 51
	@Override
51
	protected boolean analyzeRecord(HashMap<String, String> record, STATE state) {
52
		boolean success = true;
53
    	Set<String> keys = record.keySet();
52
	protected void analyzeRecord(HashMap<String, String> record, STATE state) {
53
		Set<String> keys = record.keySet();
54 54
    	
55 55
    	ROW row = createDataHolderRow();
56 56
    	state.setCurrentRow(row);
......
61 61
    			continue;
62 62
    		}
63 63
    		if (isBaseColumn(keyValue)){
64
    			success &= handleBaseColumn(keyValue, row);
64
    			handleBaseColumn(keyValue, row);
65 65
    		}else{
66
    			success &= analyzeSingleValue(keyValue, state);
66
    			analyzeSingleValue(keyValue, state);
67 67
    		}
68 68
    	}
69
    	return success;
69
    	return;
70 70
	}
71 71
	
72 72
	protected abstract ROW createDataHolderRow();
......
77 77
	 * @param state 
78 78
	 * @return
79 79
	 */
80
	protected abstract boolean analyzeSingleValue(KeyValue keyValue, STATE state);
80
	protected abstract void analyzeSingleValue(KeyValue keyValue, STATE state);
81 81

  
82 82
	/**
83 83
	 *	DataHolder class for all key and value information for a cell.
......
111 111
		Author("RefAuthor"),
112 112
		Title("RefTitle"),
113 113
		Year("RefYear"),
114
		RefExtension("RefExt(ension)?"),
114 115
		Language("Lang") //strictly not a reference, so some refactoring/renaming is needed
115 116
		;
116 117
		
......
241 242
		String key = keyValue.key;
242 243
		if (key.matches(CDM_UUID_COLUMN)){
243 244
			return true;
245
		} else if(keyValue.key.matches(IGNORE_COLUMN)) {
246
			logger.debug("Ignored column" + keyValue.originalKey);
247
			return true;
244 248
		}
245 249
		return false;
246 250
	}

Also available in: Unified diff