/** * Build up this event role with details. * * * @param details The details. * @return this. */ public EventRole details(String details) { setDetails(details); return this; }
/** * Build up this role with a type. * * @param type The type. * @return this. */ public EventRole type(EventRoleType type) { setKnownType(type); return this; }
/** * Build up this event role with a person. * @param person The person. * @return this. */ public EventRole person(ResourceReference person) { setPerson(person); return this; }
/** * Build up this role with a type. * * @param type The type. * @return this. */ public EventRole type(URI type) { setType(type); return this; }
/** * The enum referencing the known role type, or {@link org.gedcomx.types.EventRoleType#OTHER} if not known. * * @return The enum referencing the known role type, or {@link org.gedcomx.types.EventRoleType#OTHER} if not known. */ @XmlTransient @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public EventRoleType getKnownType() { return getType() == null ? null : EventRoleType.fromQNameURI(getType()); }
@Override public void visitEvent(Event event) { this.contextStack.push(event); visitSubject(event); Date date = event.getDate(); if (date != null) { date.accept(this); } PlaceReference place = event.getPlace(); if (place != null) { place.accept(this); } List<EventRole> roles = event.getRoles(); if (roles != null) { for (EventRole role : roles) { if (role != null) { role.accept(this); } } } this.contextStack.pop(); }
/** * Set the role type from an enumeration of known role types. * * @param knownType The role type. */ @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public void setKnownType(EventRoleType knownType) { setType(knownType == null ? null : knownType.toQNameURI()); }
/** * Build up this event role with a person. * @param person The person. * @return this. */ public EventRole person(Person person) { if (person.getId() == null) { throw new IllegalStateException("Cannot reference person: no id."); } setPerson(new ResourceReference(URI.create("#" + person.getId()))); return this; }