Revision 9f6a56c9
Added by Andreas Müller almost 3 years ago
cdmlib-model/src/main/java/eu/etaxonomy/cdm/model/agent/Person.java | ||
---|---|---|
9 | 9 |
|
10 | 10 |
package eu.etaxonomy.cdm.model.agent; |
11 | 11 |
|
12 |
import java.beans.PropertyChangeEvent; |
|
13 |
import java.beans.PropertyChangeListener; |
|
12 | 14 |
import java.util.HashSet; |
13 | 15 |
import java.util.Set; |
14 | 16 |
|
... | ... | |
68 | 70 |
"givenName", |
69 | 71 |
"initials", |
70 | 72 |
"suffix", |
73 |
"nomenclaturalTitle", |
|
71 | 74 |
"collectorTitle", |
72 | 75 |
"lifespan", |
73 | 76 |
"orcid", |
... | ... | |
84 | 87 |
private static final long serialVersionUID = 4153566493065539763L; |
85 | 88 |
public static final Logger logger = Logger.getLogger(Person.class); |
86 | 89 |
|
87 |
//under construction #4311 |
|
90 |
@XmlElement(name="NomenclaturalTitle") |
|
91 |
@Field(index=Index.YES) |
|
92 |
@NullOrNotEmpty |
|
93 |
@Column(length=255) |
|
94 |
protected String nomenclaturalTitle; |
|
95 |
|
|
88 | 96 |
@XmlElement(name="CollectorTitle") |
89 | 97 |
@Field(index=Index.YES) |
98 |
@NullOrNotEmpty |
|
90 | 99 |
@Column(length=255) |
91 | 100 |
private String collectorTitle; |
92 | 101 |
|
... | ... | |
216 | 225 |
this.cacheStrategy = PersonDefaultCacheStrategy.NewInstance(); |
217 | 226 |
} |
218 | 227 |
|
228 |
@Override |
|
229 |
public void initListener(){ |
|
230 |
PropertyChangeListener listener = new PropertyChangeListener() { |
|
231 |
@Override |
|
232 |
public void propertyChange(PropertyChangeEvent ev) { |
|
233 |
if (!ev.getPropertyName().equals("titleCache") |
|
234 |
&& !ev.getPropertyName().equals("nomenclaturalTitleCache") //not sure if called at all |
|
235 |
&& !ev.getPropertyName().equals("collectorTitleCache") //not sure if called at all |
|
236 |
&& !ev.getPropertyName().equals("cacheStrategy")){ |
|
237 |
if (! isProtectedTitleCache()){ |
|
238 |
titleCache = null; |
|
239 |
} |
|
240 |
nomenclaturalTitleCache = null; |
|
241 |
collectorTitleCache = null; |
|
242 |
} |
|
243 |
} |
|
244 |
}; |
|
245 |
addPropertyChangeListener(listener); |
|
246 |
} |
|
247 |
|
|
219 | 248 |
// *********************** GETTER SETTER ADDER **********************************/ |
220 | 249 |
|
221 | 250 |
|
... | ... | |
318 | 347 |
this.collectorTitle = collectorTitle; |
319 | 348 |
} |
320 | 349 |
|
350 |
public String getNomenclaturalTitle() { |
|
351 |
return nomenclaturalTitle; |
|
352 |
} |
|
353 |
@Override |
|
354 |
public void setNomenclaturalTitle(String nomenclaturalTitle) { |
|
355 |
this.nomenclaturalTitle = isBlank(nomenclaturalTitle) ? null : nomenclaturalTitle; |
|
356 |
} |
|
357 |
|
|
321 | 358 |
/** |
322 | 359 |
* Returns the initials of this person as used in bibliographic |
323 | 360 |
* references. Usually these are the first letters of each givenname |
Also available in: Unified diff
ref #9664 first implementation for TeamOrPersonBase.nomenclaturalTitleCache (update script still missing)