org.gedcomx
Class Gedcomx

java.lang.Object
  extended by org.gedcomx.common.ExtensibleData
      extended by org.gedcomx.links.HypermediaEnabledData
          extended by org.gedcomx.Gedcomx
All Implemented Interfaces:
HasTransientProperties, SupportsLinks, SupportsExtensionElements

public class Gedcomx
extends HypermediaEnabledData

The GEDCOM X data formats define the serialization formats of the GEDCOM X conceptual model. The canonical documentation is provided by the formal specification documents:

This documentation is provided as a non-normative reference guide.

Author:
Ryan Heaton

Field Summary
 
Fields inherited from class org.gedcomx.common.ExtensibleData
extensionElements, transientProperties
 
Constructor Summary
Gedcomx()
           
 
Method Summary
 void accept(GedcomxModelVisitor visitor)
          Accept a visitor.
 void addAgent(Agent agent)
          Add a agent to the data set.
 void addCollection(Collection collection)
          Add a collection to the data set.
 void addDocument(Document document)
          Add a document to the data set.
 void addEvent(Event event)
          Add a event to the data set.
 void addField(Field field)
          Add a field to the data set.
 void addPerson(Person person)
          Add a person to the data set.
 void addPlace(PlaceDescription place)
          Add a place to the data set.
 void addRecordDescriptor(RecordDescriptor recordDescriptor)
          Add a recordDescriptor to the data set.
 void addRelationship(Relationship relationship)
          Add a relationship to the data set.
 void addSourceDescription(SourceDescription sourceDescription)
          Add a source description to the data set.
 Gedcomx agent(Agent agent)
          Build this out with a agent.
 Gedcomx attribution(Attribution attribution)
          Build this out with an attribution.
 Gedcomx collection(Collection collection)
          Build this out with a collection.
 Gedcomx descriptionRef(URI descriptionRef)
          Build out this with a description ref.
 Gedcomx document(Document document)
          Build this out with a document.
 void embed(Gedcomx gedcomx)
           
 Gedcomx event(Event event)
          Build this out with a event.
 Gedcomx field(Field field)
          Build this out with a field.
 Relationship findCoupleRelationship(FamilyView family)
          Find the couple relationship (if any) that corresponds to the relationship between the parents in the given family.
 Relationship findCoupleRelationship(ResourceReference person1, ResourceReference person2)
          Find the couple relationship (if any) that corresponds to the relationship between the people with the given IDs.
 Relationship findParentChildRelationship(ResourceReference parent, ResourceReference child)
          Find the parent-child relationship between the given two persons.
 List<Agent> getAgents()
          The agents included in this genealogical data set.
 Attribution getAttribution()
          The attribution of this genealogical data.
 List<Collection> getCollections()
          The collections included in this genealogical data set.
 List<Relationship> getCoupleRelationships()
          Get the list of couple relationships in the document.
 URI getDescriptionRef()
          A reference to a description of this data set.
 List<Document> getDocuments()
          The documents included in this genealogical data set.
 List<Event> getEvents()
          The events included in this genealogical data set.
 List<Field> getFields()
          The extracted fields included in this genealogical data set.
 String getLang()
          The language of this genealogical data set.
 List<Relationship> getParentChildRelationships()
          Get the list of parent-child relationships in the document.
 Person getPerson()
          Get the first person in the document.
 List<Person> getPersons()
          The persons included in this genealogical data set.
 List<PlaceDescription> getPlaces()
          The places included in this genealogical data set.
 URI getProfile()
          A reference to the profile that describes this data set.
 List<RecordDescriptor> getRecordDescriptors()
          The record descriptors included in this genealogical data set.
 List<Relationship> getRelationships()
          The relationships included in this genealogical data set.
 SourceDescription getSourceDescription()
          Get the first source description in the document.
 SourceDescription getSourceDescription(URI resourceType)
          Get the first source description in the document with the type that is specified.
 List<SourceDescription> getSourceDescriptions()
          The descriptions of sources included in this genealogical data set.
 Gedcomx lang(String lang)
          Build out this envelope with a lang.
 Gedcomx person(Person person)
          Build this out with a person.
 Gedcomx place(PlaceDescription place)
          Build this out with a place.
 Gedcomx recordDescriptor(RecordDescriptor recordDescriptor)
          Build this out with a record descriptor.
 Gedcomx relationship(Relationship relationship)
          Build this out with a relationship.
protected static boolean samePerson(ResourceReference ref1, ResourceReference ref2)
          Tell whether the given resource reference is referencing the current person
 void setAgents(List<Agent> agents)
          The agents included in this genealogical data set.
 void setAttribution(Attribution attribution)
          The attribution of this genealogical data.
 void setCollections(List<Collection> collections)
          The collections included in this genealogical data set.
 void setDescriptionRef(URI descriptionRef)
          A reference to a description of this data set.
 void setDocuments(List<Document> documents)
          The documents included in this genealogical data set.
 void setEvents(List<Event> events)
          The events included in this genealogical data set.
 void setFields(List<Field> fields)
          The extracted fields included in this genealogical data set.
 void setLang(String lang)
          The language of this genealogical data set.
 void setPersons(List<Person> persons)
          The persons included in this genealogical data set.
 void setPlaces(List<PlaceDescription> places)
          The places included in this genealogical data set.
 void setProfile(URI profile)
          A reference to the profile that describes this data set.
 void setRecordDescriptors(List<RecordDescriptor> recordDescriptors)
          The record descriptors included in this genealogical data set.
 void setRelationships(List<Relationship> relationships)
          The relationships included in this genealogical data set.
 void setSourceDescriptions(List<SourceDescription> sourceDescriptions)
          The descriptions of sources included in this genealogical data set.
 Gedcomx sourceDescription(SourceDescription sourceDescription)
          Build this out with a source description.
 
Methods inherited from class org.gedcomx.links.HypermediaEnabledData
addLink, addLink, addTemplatedLink, embed, getLink, getLinks, getLinks, link, link, setLinks
 
Methods inherited from class org.gedcomx.common.ExtensibleData
addExtensionElement, embed, findExtensionOfType, findExtensionOfType, findExtensionsOfType, findExtensionsOfType, getExtensionElements, getId, getTransientProperties, getTransientProperty, id, removeExtensionElements, setExtensionElement, setExtensionElements, setId, setTransientProperty, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Gedcomx

public Gedcomx()
Method Detail

getLang

public String getLang()
The language of this genealogical data set. See http://www.w3.org/International/articles/language-tags/. Note that some language-enabled elements MAY override the language.

Returns:
The language of the genealogical data.

setLang

public void setLang(String lang)
The language of this genealogical data set. See http://www.w3.org/International/articles/language-tags/. Note that some language-enabled elements MAY override the language.

Parameters:
lang - The language of this genealogical data.

lang

public Gedcomx lang(String lang)
Build out this envelope with a lang.

Parameters:
lang - The lang.
Returns:
this.

getProfile

public URI getProfile()
A reference to the profile that describes this data set.

Returns:
A reference to the profile that describes this data set.

setProfile

public void setProfile(URI profile)
A reference to the profile that describes this data set.

Parameters:
profile - A reference to the profile that describes this data set.

getDescriptionRef

public URI getDescriptionRef()
A reference to a description of this data set.

Returns:
A reference to a description of this data set.

setDescriptionRef

public void setDescriptionRef(URI descriptionRef)
A reference to a description of this data set.

Parameters:
descriptionRef - A reference to a description of this data set.

descriptionRef

public Gedcomx descriptionRef(URI descriptionRef)
Build out this with a description ref.

Parameters:
descriptionRef - The description ref.
Returns:
this.

getAttribution

public Attribution getAttribution()
The attribution of this genealogical data.

Returns:
The attribution of this genealogical data.

setAttribution

public void setAttribution(Attribution attribution)
The attribution of this genealogical data.

Parameters:
attribution - The attribution of this genealogical data.

attribution

public Gedcomx attribution(Attribution attribution)
Build this out with an attribution.

Parameters:
attribution - The attribution.
Returns:
this.

getPerson

public Person getPerson()
Get the first person in the document.

Returns:
The first person in the document.

getPersons

public List<Person> getPersons()
The persons included in this genealogical data set.

Returns:
The persons included in this genealogical data set.

setPersons

public void setPersons(List<Person> persons)
The persons included in this genealogical data set.

Parameters:
persons - The persons included in this genealogical data set.

person

public Gedcomx person(Person person)
Build this out with a person.

Parameters:
person - The person.
Returns:
this.

addPerson

public void addPerson(Person person)
Add a person to the data set.

Parameters:
person - The person to be added.

getCoupleRelationships

public List<Relationship> getCoupleRelationships()
Get the list of couple relationships in the document.

Returns:
The list of couple relationships in the document.

getParentChildRelationships

public List<Relationship> getParentChildRelationships()
Get the list of parent-child relationships in the document.

Returns:
The list of parent-child relationships in the document.

findCoupleRelationship

public Relationship findCoupleRelationship(FamilyView family)
Find the couple relationship (if any) that corresponds to the relationship between the parents in the given family.

Parameters:
family - - Family to find the couple relationship for.
Returns:
the couple relationship for the parents in the family, if any, or null if there isn't one (or if there are not two parents).

findCoupleRelationship

public Relationship findCoupleRelationship(ResourceReference person1,
                                           ResourceReference person2)
Find the couple relationship (if any) that corresponds to the relationship between the people with the given IDs.

Parameters:
person1 - - person1 to find (i.e., husband)
person2 - - person2 to find (i.e., wife)
Returns:
the couple relationship for the parents in the family, if any, or null if there isn't one (or if there are not two parents).

findParentChildRelationship

public Relationship findParentChildRelationship(ResourceReference parent,
                                                ResourceReference child)
Find the parent-child relationship between the given two persons.

Parameters:
parent - - Reference to the parent to find.
child - - Reference to the child to find.
Returns:
parent-child relationship for the given parent and child, or null if not found in the document.

samePerson

protected static boolean samePerson(ResourceReference ref1,
                                    ResourceReference ref2)
Tell whether the given resource reference is referencing the current person

Parameters:
ref1 - - Local reference to a person URI.
Returns:
true if the personReference is referencing this person (or both are null). False otherwise.

getRelationships

public List<Relationship> getRelationships()
The relationships included in this genealogical data set.

Returns:
The relationships included in this genealogical data set.

setRelationships

public void setRelationships(List<Relationship> relationships)
The relationships included in this genealogical data set.

Parameters:
relationships - The relationships included in this genealogical data set.

relationship

public Gedcomx relationship(Relationship relationship)
Build this out with a relationship.

Parameters:
relationship - The relationship.
Returns:
this.

addRelationship

public void addRelationship(Relationship relationship)
Add a relationship to the data set.

Parameters:
relationship - The relationship to be added.

getSourceDescription

public SourceDescription getSourceDescription()
Get the first source description in the document.

Returns:
The first source description in the document.

getSourceDescription

public SourceDescription getSourceDescription(URI resourceType)
Get the first source description in the document with the type that is specified.

Parameters:
resourceType - The URI resource type of the SourceDescription you are trying to find.
Returns:
The first source description in the document with the type that is specified..

getSourceDescriptions

public List<SourceDescription> getSourceDescriptions()
The descriptions of sources included in this genealogical data set.

Returns:
The descriptions of sources included in this genealogical data set.

setSourceDescriptions

public void setSourceDescriptions(List<SourceDescription> sourceDescriptions)
The descriptions of sources included in this genealogical data set.

Parameters:
sourceDescriptions - The descriptions of sources included in this genealogical data set.

sourceDescription

public Gedcomx sourceDescription(SourceDescription sourceDescription)
Build this out with a source description.

Parameters:
sourceDescription - The source description.
Returns:
this.

addSourceDescription

public void addSourceDescription(SourceDescription sourceDescription)
Add a source description to the data set.

Parameters:
sourceDescription - The source description to be added.

getAgents

public List<Agent> getAgents()
The agents included in this genealogical data set.

Returns:
The agents included in this genealogical data set.

setAgents

public void setAgents(List<Agent> agents)
The agents included in this genealogical data set.

Parameters:
agents - The agents included in this genealogical data set.

agent

public Gedcomx agent(Agent agent)
Build this out with a agent.

Parameters:
agent - The agent.
Returns:
this.

addAgent

public void addAgent(Agent agent)
Add a agent to the data set.

Parameters:
agent - The agent to be added.

getEvents

public List<Event> getEvents()
The events included in this genealogical data set.

Returns:
The events included in this genealogical data set.

setEvents

public void setEvents(List<Event> events)
The events included in this genealogical data set.

Parameters:
events - The events included in this genealogical data set.

event

public Gedcomx event(Event event)
Build this out with a event.

Parameters:
event - The event.
Returns:
this.

addEvent

public void addEvent(Event event)
Add a event to the data set.

Parameters:
event - The event to be added.

getPlaces

public List<PlaceDescription> getPlaces()
The places included in this genealogical data set.

Returns:
The places included in this genealogical data set.

setPlaces

public void setPlaces(List<PlaceDescription> places)
The places included in this genealogical data set.

Parameters:
places - The places included in this genealogical data set.

place

public Gedcomx place(PlaceDescription place)
Build this out with a place.

Parameters:
place - The place.
Returns:
this.

addPlace

public void addPlace(PlaceDescription place)
Add a place to the data set.

Parameters:
place - The place to be added.

getDocuments

public List<Document> getDocuments()
The documents included in this genealogical data set.

Returns:
The documents included in this genealogical data set.

setDocuments

public void setDocuments(List<Document> documents)
The documents included in this genealogical data set.

Parameters:
documents - The documents included in this genealogical data set.

document

public Gedcomx document(Document document)
Build this out with a document.

Parameters:
document - The document.
Returns:
this.

addDocument

public void addDocument(Document document)
Add a document to the data set.

Parameters:
document - The document to be added.

getCollections

public List<Collection> getCollections()
The collections included in this genealogical data set.

Returns:
The collections included in this genealogical data set.

setCollections

public void setCollections(List<Collection> collections)
The collections included in this genealogical data set.

Parameters:
collections - The collections included in this genealogical data set.

collection

public Gedcomx collection(Collection collection)
Build this out with a collection.

Parameters:
collection - The collection.
Returns:
this.

addCollection

public void addCollection(Collection collection)
Add a collection to the data set.

Parameters:
collection - The collection to be added.

getFields

public List<Field> getFields()
The extracted fields included in this genealogical data set. Fields that apply to a particular person, relationship or value should be included within that person or value, respectively. Remaining fields that did not have a place within the person or relationship structure can be included here. Also, fields that were extracted but not yet fit into a structure can also be included here.

Returns:
The extracted fields included in this genealogical data set.

setFields

public void setFields(List<Field> fields)
The extracted fields included in this genealogical data set.

Parameters:
fields - The extracted fields included in this genealogical data set.

field

public Gedcomx field(Field field)
Build this out with a field.

Parameters:
field - The field.
Returns:
this.

addField

public void addField(Field field)
Add a field to the data set.

Parameters:
field - The field to be added.

getRecordDescriptors

public List<RecordDescriptor> getRecordDescriptors()
The record descriptors included in this genealogical data set.

Returns:
The record descriptors included in this genealogical data set.

setRecordDescriptors

public void setRecordDescriptors(List<RecordDescriptor> recordDescriptors)
The record descriptors included in this genealogical data set.

Parameters:
recordDescriptors - The record descriptors included in this genealogical data set.

recordDescriptor

public Gedcomx recordDescriptor(RecordDescriptor recordDescriptor)
Build this out with a record descriptor.

Parameters:
recordDescriptor - The record descriptor.
Returns:
this.

addRecordDescriptor

public void addRecordDescriptor(RecordDescriptor recordDescriptor)
Add a recordDescriptor to the data set.

Parameters:
recordDescriptor - The recordDescriptor to be added.

accept

public void accept(GedcomxModelVisitor visitor)
Accept a visitor.

Parameters:
visitor - The visitor.

embed

public void embed(Gedcomx gedcomx)


Copyright © 2015. All rights reserved.