Package org.gedcomx.util
Class DocCheck
- java.lang.Object
-
- org.gedcomx.util.DocCheck
-
public class DocCheck extends Object
Class for checking a GedcomX document to make sure its references are consistent. User: Randy Wilson Date: 10/2/2014 Time: 3:49 PM
-
-
Constructor Summary
Constructors Constructor Description DocCheck()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringcheckDocument(Gedcomx doc)Check a GedcomX document for problems.static StringcheckDocument(Gedcomx doc, Gedcomx collection)Check a GedcomX document for problems.static StringcheckRecordSet(RecordSet records, Gedcomx collection)Check a GedcomX RecordSet for problems.
-
-
-
Method Detail
-
checkDocument
public static String checkDocument(Gedcomx doc)
Check a GedcomX document for problems. Check the following: - There is a SourceDescription for the document, referenced by 'description'. - All SourceReference's point to a valid, local SourceDescription. - SourceReferences can appear as componentOf in a SourceDescription, - and also in any Conclusion - All relationships point to persons who are either (a) inside the doc, referenced by "#" + local ID, or (b) outside the doc, referenced by full URL. - All persons, records and collections have an identifier of type "Persistent" or "Primary". - PlaceReference references a valid PlaceDescription.- Parameters:
doc- - Document to check- Returns:
- String containing a list of errors, or null if there were no errors.
-
checkDocument
public static String checkDocument(Gedcomx doc, Gedcomx collection)
Check a GedcomX document for problems. Calls checkDocument(doc), but further makes sure that all field values with a labelId can find the labelId in the RecordDescriptor in the accompanying collection doc.- Parameters:
doc- - Historical Record document to check.collection- - Collection document to find RecordDescriptor in.- Returns:
- String containing a list of errors, if any, or null if there were no errors.
-
checkRecordSet
public static String checkRecordSet(RecordSet records, Gedcomx collection)
Check a GedcomX RecordSet for problems. Calls checkDocument(doc, collection) on each record.- Parameters:
records- - Set of GedcomX documents to check.collection- - Collection to use to check RecordDescriptors and labelIds. If null, use records.getMetadata(), if any, or else don't check label IDs.- Returns:
- String containing a list of errors, if any, or null if there were no errors.
-
-