Views
Personal tools

Architecture

From Genea-GEDCOM

Jump to: navigation, search

To understand the architecture of Genea-GEDCOM, you first need to know how parsing GEDCOM data works.

  1. The process starts with a LineageLinkegGedcom object, which is placed on a stack.
  2. The first line of the GEDCOM data is read, and a HEAD tag is encountered.
  3. The parser searches the stack's topmost object (LineageLinkegGedcom in the first run) for a property that is tagged correctly (HEAD in the first run).
  4. The properties type is determined and an object of this type is created. The type must inherit GedcomLine.
  5. The value of the property which was found before is set to the newly created object; The object is pushed on the stack.
  6. The next line is read; if its level is equal or lower, items are popped from the stack and the process starts from point 3.

Contents

[edit] GedcomLines

[edit] One Tag for two Properties per Class

Generally, a tag may only be used for one property per class. The only exception is, that it can be used for two, when one of the properties can only be read and the other one can only be written. This is currently only used in the class ContinueableText, where two properties (tags Continue and Concatenate) are used for adding text and one property (AdditionalLines) is used for returning the complete text.

[edit] Multiple Tags per Property

A tag may have multiple tags where each can (bust needn't) have another type associated with it. This can be useful, if the object that should be created depends on the tag or, if the property is an container and objects of different types may be added. In this case, the associated types must be derived from the property's type.

[edit] Lists

If a gedcom line may have several sub-lines of the same type, the associated property can be declated as a list. Its tags must state the types of the objects that may be added and not the type of the list. The fact, that the objects should be added to the list (instead of assigned to the property) is auto-detected by the parser. If multiple tags are used to associate several types, all of these must be derived from the container's item-type, not from the container's type itself.

[edit] Generic GedcomLine-classes

Toolbox