Package org.gedcomx.conclusion

Examples of org.gedcomx.conclusion.Person


    mapper.toPerson(dqPerson, result);
    assertNotNull(result.getPersons());
    assertEquals(result.getPersons().size(), 1);

    Person gedxPerson = result.getPersons().get(0);
    assertNotNull(gedxPerson.getFacts());
    assertEquals(gedxPerson.getFacts().size(), 1);
    Fact gedxFact = gedxPerson.getFacts().get(0);
    assertNotNull(gedxFact);
    assertNotNull(gedxFact.getSources());
    assertEquals(gedxFact.getSources().size(), 1);
    SourceReference gedxSourceReference = gedxFact.getSources().get(0);
    assertNotNull(gedxSourceReference);
View Full Code Here


    mapper.toPerson(dqPerson, result);
    assertNotNull(result.getPersons());
    assertEquals(result.getPersons().size(), 1);

    Person gedxPerson = result.getPersons().get(0);
    assertNotNull(gedxPerson.getFacts());
    assertEquals(gedxPerson.getFacts().size(), 1);
    Fact gedxFact = gedxPerson.getFacts().get(0);
    assertNotNull(gedxFact);
    assertNotNull(gedxFact.getSources());
    assertEquals(gedxFact.getSources().size(), 1);
    SourceReference gedxSourceReference = gedxFact.getSources().get(0);
    assertNotNull(gedxSourceReference);
View Full Code Here

    mapper.toPerson(dqPerson, result);
    assertNotNull(result.getPersons());
    assertEquals(result.getPersons().size(), 1);

    Person gedxPerson = result.getPersons().get(0);
    assertNotNull(gedxPerson.getFacts());
    assertEquals(gedxPerson.getFacts().size(), 1);
    Fact gedxFact = gedxPerson.getFacts().get(0);
    assertNotNull(gedxFact);
    assertNull(gedxFact.getSources());
// TODO: will probably be needed when the TEXT tag starts being processed
//    assertEquals(gedxFact.getSources().size(), 1);
//    SourceReference gedxSourceReference = gedxFact.getSources().get(0);
View Full Code Here

    }

    Marker personContext = ConversionContext.getDetachedMarker(String.format("@%s@ INDI", dqPerson.getId()));
    ConversionContext.addReference(personContext);
    try {
      Person gedxPerson = new Person();
      gedxPerson.setId(dqPerson.getId());

      //////////////////////////////////////////////////////////////////////
      // Process NAMES

      int index = 0;
      List<Name> gedxNames = new ArrayList<Name>();
      for (org.folg.gedcom.model.Name dqName : dqPerson.getNames()) {
        Marker nameContext = ConversionContext.getDetachedMarker("NAME." + (++index));
        ConversionContext.addReference(nameContext);
        try {
          int cntNamesBeforeThisNameObj = gedxNames.size();
          gedxNames.addAll(toNameList(dqName, result));
          if ((cntNamesBeforeThisNameObj == 0) && (gedxNames.size() > 0)) {
            // the first name encountered is assumed to be the preferred name per the recommendation given in the GEDCOM 5.5.1 specification
            gedxNames.get(0).setPreferred(Boolean.TRUE);
          }
        } finally {
          ConversionContext.removeReference(nameContext);
        }
      }

      if (gedxNames.size() > 0) {
        gedxPerson.setNames(gedxNames);
      }


      //////////////////////////////////////////////////////////////////////
      // Process facts

      processFacts(gedxPerson, dqPerson.getEventsFacts(), result);


      //////////////////////////////////////////////////////////////////////
      // Process sources

      List<SourceReference> sources = CommonMapper.toSourcesAndSourceReferences(dqPerson.getSourceCitations(), result);
      gedxPerson.setSources(sources);


      //////////////////////////////////////////////////////////////////////
      // Add the person to the conversion results
      java.util.Date lastModified = CommonMapper.toDate(dqPerson.getChange()); //todo: set the timestamp on the attribution?
View Full Code Here

TOP

Related Classes of org.gedcomx.conclusion.Person

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.