/** * Build out this name part with a field. * @param field The field. * @return this. */ public NamePart field(Field field) { addField(field); return this; }
/** * Build out this name part with a qualifier. * * @param qualifier The qualifier. * @return this. */ public NamePart qualifier(Qualifier qualifier) { addQualifier(qualifier); return this; }
public NamePart(NamePartType type, String text) { setKnownType(type); setValue(text); }
/** * Gets a specific part of the name * @param namePartType specific part of the name to retrieve * @return the specific part of the name that matches the given NamePartType */ public String getPart(NamePartType namePartType) { if(this.nameForms == null || this.nameForms.isEmpty() || this.nameForms.get(0) == null || this.nameForms.get(0).getParts() == null) { return null; } for(NamePart namePart : this.nameForms.get(0).getParts()) { if(namePart.getKnownType() == namePartType) { return namePart.getValue(); } } return null; }
/** * Build out this name part with a type. * * @param type The type. * @return this. */ public NamePart type(URI type) { setType(type); return this; }
@Override public void visitNamePart(NamePart part) { this.contextStack.push(part); List<Field> fields = part.getFields(); if (fields != null) { for (Field field : fields) { if (field != null) { field.accept(this); } } } this.contextStack.pop(); }
/** * Build out this name part with a type. * * @param type The type. * @return this. */ public NamePart type(NamePartType type) { setKnownType(type); return this; }
/** * The enum referencing the known name part type, or {@link org.gedcomx.types.NamePartType#OTHER} if not known. * * @return The enum referencing the known name part type, or {@link org.gedcomx.types.NamePartType#OTHER} if not known. */ @XmlTransient @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public NamePartType getKnownType() { return getType() == null ? null : NamePartType.fromQNameURI(getType()); }
/** * Build up this name form with a part. * * @param partType The part type. * @param value The value. * @return this. */ public NameForm part(NamePartType partType, String value) { addPart(new NamePart(partType, value)); return this; }
@Override public void visitNameForm(NameForm form) { this.contextStack.push(form); List<NamePart> parts = form.getParts(); if (parts != null) { for (NamePart part : parts) { if (part != null) { part.accept(this); } } } List<Field> fields = form.getFields(); if (fields != null) { for (Field field : fields) { if (field != null) { field.accept(this); } } } this.contextStack.pop(); }
/** * Set the type of this name part from an enumeration of known name part types. * * @param knownType The name part type. */ @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public void setKnownType(NamePartType knownType) { setType(knownType == null ? null : knownType.toQNameURI()); }
if (nameForm.getParts() != null) { for (NamePart namePart : nameForm.getParts()) { addFields(namePart.getFields(), person, personFieldsMap);