/** * Build up this fact with a field. * * @param field The field. * @return this. */ public Fact field(Field field) { addField(field); return this; }
/** * Build up this fact with a qualifier. * * @param qualifier The qualifier. * @return this. */ public Fact qualifier(Qualifier qualifier) { addQualifier(qualifier); return this; }
@Override public String toString() { return "type=" + getKnownType() + ",value=" + getValue() + ",date=" + getDate() + ",place=" + getPlace(); }
@Override public void visitFact(Fact fact) { this.contextStack.push(fact); visitConclusion(fact); Date date = fact.getDate(); if (date != null) { date.accept(this); } PlaceReference place = fact.getPlace(); if (place != null) { place.accept(this); } List<Field> fields = fact.getFields(); if (fields != null) { for (Field field : fields) { if (field != null) { field.accept(this); } } } this.contextStack.pop(); }
@Override public void visitChildAndParentsRelationship(ChildAndParentsRelationship pcr) { this.contextStack.push( pcr ); visitConclusion( pcr ); List<Fact> facts; facts = pcr.getFatherFacts(); if (facts != null) { for (Fact fact : facts) { if (fact != null) { fact.accept(this); } } } facts = pcr.getMotherFacts(); if (facts != null) { for (Fact fact : facts) { if (fact != null) { fact.accept(this); } } } this.contextStack.pop(); }
checkSources(errors, whereReferencedFrom + " (fact)", fact.getSources(), null, fact.getFields(), docMap); checkPlace(errors, fact.getPlace(), docMap);
public RelationshipState deleteFact(Fact fact, StateTransitionOption... options) { Link link = fact.getLink(Rel.CONCLUSION); link = link == null ? fact.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Conclusion cannot be deleted: missing link."); } ClientRequest request = createAuthenticatedGedcomxRequest().build(link.getHref().toURI(), HttpMethod.DELETE); return this.stateFactory.newRelationshipState(request, invoke(request, options), this.accessToken); }
/** * Helper method for obtaining specific fact conclusions. * * @param factType The type of facts to return. * @return The fact conclusions that match the factType. An empty list will be returned if no facts are found. */ @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public List<Fact> getFacts(FactType factType) { ArrayList<Fact> factsToReturn = new ArrayList<Fact>(); if (facts != null && factType != null) { for (Fact fact : facts) { if (fact.getKnownType() != null && fact.getKnownType().equals(factType)) { factsToReturn.add(fact); } } } return factsToReturn; }
/** * The primary fact for this person. * * @return The primary fact for this person. */ @XmlTransient @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public Fact getPrimaryFact() { if (this.facts == null) { return null; } for (Fact fact : this.facts) { if (fact.getPrimary() != null && fact.getPrimary()) { return fact; } } return null; }
@Override public void visitRelationship(Relationship relationship) { this.contextStack.push(relationship); visitSubject(relationship); List<Fact> facts = relationship.getFacts(); if (facts != null) { for (Fact fact : facts) { if (fact != null) { fact.accept(this); } } } List<Field> fields = relationship.getFields(); if (fields != null) { for (Field field : fields) { if (field != null) { field.accept(this); } } } this.contextStack.pop(); }
public ChildAndParentsRelationshipState deleteFact(Fact fact, StateTransitionOption... options) { Link link = fact.getLink(Rel.CONCLUSION); link = link == null ? fact.getLink(Rel.SELF) : link; if (link == null || link.getHref() == null) { throw new GedcomxApplicationException("Conclusion cannot be deleted: missing link."); } ClientRequest request = RequestUtil.applyFamilySearchConneg(createAuthenticatedGedcomxRequest()).build(link.getHref().toURI(), HttpMethod.DELETE); return ((FamilyTreeStateFactory)this.stateFactory).newChildAndParentsRelationshipState(request, invoke(request, options), this.accessToken); }
/** * Get the first fact of the specified type. * * @param type The type. * @return the first fact in the fact list of the specified type, or null if none. */ @JsonIgnore @org.codehaus.jackson.annotate.JsonIgnore public Fact getFirstFactOfType(FactType type) { if (this.facts == null) { return null; } for (Fact fact : this.facts) { if (type.equals(fact.getKnownType())) { return fact; } } return null; }
for (Fact fact : facts) { if (fact != null) { fact.accept(this);