public class FieldMap extends Object
| Constructor and Description |
|---|
FieldMap(DocMap recordDocMap,
DocMap collectionDocMap)
Constructor using a DocMap for a collection and record.
|
FieldMap(Gedcomx record,
Gedcomx collection)
Constructor for a collection and record GedcomX document.
|
| Modifier and Type | Method and Description |
|---|---|
static List<Field> |
getAllFields(Gedcomx record)
Create a list of all of the fields occurring in the given GedcomX record, including those found
within the various values.
|
Gedcomx |
getCollection()
Get the GedcomX document for the collection that the record is found in.
|
DocMap |
getCollectionDocMap()
Get the DocMap for the collection that the record is found in.
|
String |
getDisplayLabel(String labelId,
String language)
Get the display label for the given labelId in the closest language available to the one given.
|
FieldValueDescriptor |
getFieldValueDescriptor(String labelId)
Get the FieldValueDescriptor for the given field value label ID.
|
Map<String,FieldValueDescriptor> |
getLabelFieldValueDescriptorMap()
Get the map of labelId to FieldValueDescriptor used by this FieldMap.
|
static Map<String,FieldValueDescriptor> |
getLabelFieldValueDescriptorMap(RecordDescriptor recordDescriptor)
Get a map of labelId to FieldValueDescriptor for that label id.
|
Map<String,List<String>> |
getLabelValueMap()
Get a map of labelId to list of values for that labelId.
|
static Map<String,List<String>> |
getLabelValuesMap(List<Field> fields)
Get a map of labelId to values from all of the FieldValues that appear in the given list of Fields.
|
static Map<Person,List<Field>> |
getPersonFieldMap(Gedcomx record)
Get a map of Person to the list of Fields for that person.
|
Map<String,List<String>> |
getPersonLabelValueMap(Person person)
Get a map of labelId to list of values for that labelId for the given person.
|
Gedcomx |
getRecord()
Get the GedcomX document for the record.
|
RecordDescriptor |
getRecordDescriptor()
Get the RecordDescriptor that goes with this record.
|
static RecordDescriptor |
getRecordDescriptor(DocMap collectionDocMap,
DocMap recordDocMap)
Find the RecordDescriptor from the collection document that is referenced by the main source description
from the record document, i.e., find the record's record descriptor in the collection.
|
DocMap |
getRecordDocMap()
Get the DocMap for the record.
|
List<String> |
getValues(Person person,
String labelId)
Get a list of values that had the given labelId in the record for the given person.
|
List<String> |
getValues(String labelId)
Get a list of values that had the given labelId in the record.
|
static boolean |
isCensus(DocMap recordDocMap)
Tell whether the record with the given DocMap is a Census record, i.e., if it has a SourceDescription with a Coverage with
a RecordType of Census.
|
static boolean |
isCensus(Gedcomx record)
Tell whether the given record is a Census record, i.e., if it has a SourceDescription with a Coverage with
a RecordType of Census.
|
static boolean |
isCensus(SourceDescription sourceDescription)
Tell whether the given SourceDescription has 'coverage' with a RecordType of census.
|
public FieldMap(Gedcomx record, Gedcomx collection)
record - - GedcomX document for a record (which is in the given collection).collection - - GedcomX document for a collection (which contains the RecordDescriptor for the record).public FieldMap(DocMap recordDocMap, DocMap collectionDocMap)
recordDocMap - - DocMap for a GedcomX document for a record (which is in the given collection)collectionDocMap - - DocMap for a GedcomX document for a collection (which contains the RecordDescriptor for the record).public DocMap getCollectionDocMap()
public DocMap getRecordDocMap()
public Gedcomx getCollection()
public Gedcomx getRecord()
public String getDisplayLabel(String labelId, String language)
labelId - labelId to get the display value for (e.g., "PR_NAME")language - Preferred language to get the display label in. If null use "en-US".public List<String> getValues(String labelId)
labelId - - LabelId to get the values forpublic List<String> getValues(Person person, String labelId)
person - person to get values for (if null, get record-level values for the given labelId, if any)labelId - LabelId to get the values forpublic FieldValueDescriptor getFieldValueDescriptor(String labelId)
labelId - - Label ID to find the FieldValueDescriptor for.public Map<String,List<String>> getPersonLabelValueMap(Person person)
person - - Person to get the map forpublic Map<String,List<String>> getLabelValueMap()
public Map<String,FieldValueDescriptor> getLabelFieldValueDescriptorMap()
public RecordDescriptor getRecordDescriptor()
public static RecordDescriptor getRecordDescriptor(DocMap collectionDocMap, DocMap recordDocMap)
collectionDocMap - - DocMap for the collection GedcomX document.recordDocMap - - DocMap for the record GedcomX document.public static Map<String,FieldValueDescriptor> getLabelFieldValueDescriptorMap(RecordDescriptor recordDescriptor)
recordDescriptor - - RecordDescriptor to build the map from.public static Map<Person,List<Field>> getPersonFieldMap(Gedcomx record)
record - - record to get field map frompublic static List<Field> getAllFields(Gedcomx record)
record - - GedcomX to get fields for.public static Map<String,List<String>> getLabelValuesMap(List<Field> fields)
fields - - list of Fields to look in for FieldValues.public static boolean isCensus(Gedcomx record)
record - - GedcomX record to examinepublic static boolean isCensus(DocMap recordDocMap)
recordDocMap - - DocMap of the GedcomX record to examinepublic static boolean isCensus(SourceDescription sourceDescription)
sourceDescription - - SourceDescription to examine for coverage.Copyright © 2016. All rights reserved.