/** * Build up this name with a name form. * * @param nameForm The name form. * @return this. */ public Name nameForm(NameForm nameForm) { addNameForm(nameForm); return this; }
@Override public String toString() { return "type=" + getKnownType() + ",nameForms[0]=" + (nameForms == null ? "null" : nameForms.get(0).getFullText()) + ",pref=" + getPreferred(); }
/** * The enum referencing the known name type, or {@link org.gedcomx.types.NameType#OTHER} if not known. * * @return The enum referencing the known name type, or {@link org.gedcomx.types.NameType#OTHER} if not known. */ @XmlTransient @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public NameType getKnownType() { return getType() == null ? null : NameType.fromQNameURI(getType()); }
@Override public void visitName(Name name) { this.contextStack.push(name); visitConclusion(name); List<NameForm> forms = name.getNameForms(); if (forms != null) { for (NameForm form : forms) { if (form != null) { form.accept(this); } } } this.contextStack.pop(); }
/** * Build up this name with a date. * @param date The date. * @return this. */ public Name date(Date date) { setDate(date); return this; }
/** * Get the preferred name of the person. If no preferred name is specified, then the first name is returned. * * @return the preferred name of the person or first name if there is no preferred name. */ @XmlTransient @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public Name getPreferredName() { if(this.names == null || this.names.size() <= 0) { return null; } for(Name name : this.names) { if(name.getPreferred() != null) { if(name.getPreferred()) { return name; } } } return this.names.get(0); }
/** * Get the first name of the specified type. * * @param type The type. * @return the first name in the name list of the specified type, or null if none. */ @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public Name getFirstNameOfType(NameType type) { if (this.names == null) { return null; } for (Name name : this.names) { if (type.equals(name.getKnownType())) { return name; } } return null; }
for (Name name : names) { if (name != null) { name.accept(this);
NameForm nameForm = person.getName().getNameForm(); if (nameForm != null) { if (nameForm.getFullText() != null) {
String name = null; if (person.getNames() != null && person.getNames().size() > 0 && person.getNames().get(0).getNameForms() != null && person.getNames().get(0).getNameForms().size() > 0) { name = person.getNames().get(0).getNameForms().get(0).getFullText();
if (name.getNameForms() != null) { for (NameForm nameForm : name.getNameForms()) { addFields(nameForm.getFields(), person, personFieldsMap); if (nameForm.getParts() != null) {
public Name(String fullText, NamePart... parts) { addNameForm(new NameForm(fullText, parts)); }