2 * Copyright (C) 2009 EDIT
3 * European Distributed Institute of Taxonomy
4 * http://www.e-taxonomy.eu
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.
9 package eu
.etaxonomy
.cdm
.strategy
.parser
;
11 import org
.apache
.commons
.lang3
.StringUtils
;
13 import eu
.etaxonomy
.cdm
.model
.term
.DefinedTerm
;
14 import eu
.etaxonomy
.cdm
.strategy
.exceptions
.UnknownCdmTypeException
;
20 public class DeterminationModifierParser
{
23 // public static final String qualifierPattern = "(?i)(aff|cf|vel. aff)\\.?";
27 public static DefinedTerm
parseDeterminationQualifier(String qualifier
) throws UnknownCdmTypeException
{
29 if (StringUtils
.isBlank(qualifier
)){
33 if (qualifier
.matches("aff(.?|inis)")){
34 term
= DefinedTerm
.DETERMINATION_MODIFIER_AFFINIS();
35 }else if (qualifier
.matches("(cf.?|confer)")){
36 term
= DefinedTerm
.DETERMINATION_MODIFIER_CONFER();
38 String message
= "Determination qualifier not supported: " + qualifier
;
39 throw new UnknownCdmTypeException(message
);