Skip to content

Commit

Permalink
Issue #83 More conversion of model to Javabeans.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Harrah (frizbog) committed Jul 4, 2016
1 parent 1f94d4c commit 77d2e6a
Show file tree
Hide file tree
Showing 59 changed files with 746 additions and 561 deletions.
Expand Up @@ -64,26 +64,26 @@ public int compare(Individual i1, Individual i2) {
}

if (n1 != null) {
if (n1.surname == null && n1.givenName == null) {
if (n1.basic.contains("/")) {
String sn = n1.basic.substring(n1.basic.indexOf("/"));
String gn = n1.basic.substring(0, n1.basic.indexOf("/"));
if (n1.getSurname() == null && n1.getGivenName() == null) {
if (n1.getBasic().contains("/")) {
String sn = n1.getBasic().substring(n1.getBasic().indexOf("/"));
String gn = n1.getBasic().substring(0, n1.getBasic().indexOf("/"));
s1 = sn + ", " + gn;
}
} else {
s1 = n1.surname + ", " + n1.givenName;
s1 = n1.getSurname() + ", " + n1.getGivenName();
}
}

if (n2 != null) {
if (n2.surname == null && n2.givenName == null) {
if (n2.basic.contains("/")) {
String sn = n2.basic.substring(n2.basic.indexOf("/"));
String gn = n2.basic.substring(0, n2.basic.indexOf("/"));
if (n2.getSurname() == null && n2.getGivenName() == null) {
if (n2.getBasic().contains("/")) {
String sn = n2.getBasic().substring(n2.getBasic().indexOf("/"));
String gn = n2.getBasic().substring(0, n2.getBasic().indexOf("/"));
s2 = sn + ", " + gn;
}
} else {
s2 = n2.surname + ", " + n2.givenName;
s2 = n2.getSurname() + ", " + n2.getGivenName();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/gedcom4j/model/AbstractCitation.java
Expand Up @@ -36,7 +36,7 @@ public abstract class AbstractCitation extends AbstractElement {
/**
* Notes on this source citation
*/
protected List<Note> notes = Options.isCollectionInitializationEnabled() ? getNotes(true) : null;
protected List<Note> notes = getNotes(Options.isCollectionInitializationEnabled());

@Override
public boolean equals(Object obj) {
Expand Down
2 changes: 1 addition & 1 deletion src/main/java/org/gedcom4j/model/AbstractElement.java
Expand Up @@ -36,7 +36,7 @@ public abstract class AbstractElement {
/**
* A list of custom tags on this item.
*/
protected List<StringTree> customTags = Options.isCollectionInitializationEnabled() ? getCustomTags(true) : null;
protected List<StringTree> customTags = getCustomTags(Options.isCollectionInitializationEnabled());

@Override
public boolean equals(Object obj) {
Expand Down
66 changes: 33 additions & 33 deletions src/main/java/org/gedcom4j/model/AbstractEvent.java
Expand Up @@ -33,6 +33,11 @@
*
*/
public abstract class AbstractEvent extends AbstractElement {
/**
* The place where this event occurred
*/
public Place place;

/**
* The address where this event took place
*/
Expand All @@ -48,6 +53,11 @@ public abstract class AbstractEvent extends AbstractElement {
*/
protected StringWithCustomTags cause;

/**
* The citations for this object
*/
protected List<AbstractCitation> citations = getCitations(Options.isCollectionInitializationEnabled());

/**
* The date of this event
*/
Expand All @@ -59,70 +69,60 @@ public abstract class AbstractEvent extends AbstractElement {
protected StringWithCustomTags description;

/**
* The place where this event occurred
*/
public Place place;

/**
* The responsible agency for this event
*/
protected StringWithCustomTags respAgency;

/**
* Either a Y or a null after the event type;
* The emails for this submitter. New for GEDCOM 5.5.1
*/
protected String yNull;
protected List<StringWithCustomTags> emails = getEmails(Options.isCollectionInitializationEnabled());

/**
* A subtype that further qualifies the type
* Fax numbers. New for GEDCOM 5.5.1.
*/
protected StringWithCustomTags subType;
protected List<StringWithCustomTags> faxNumbers = getFaxNumbers(Options.isCollectionInitializationEnabled());

/**
* The religious affiliation of this event. New for GEDCOM 5.5.1.
* Multimedia links for this source citation
*/
protected StringWithCustomTags religiousAffiliation;
protected List<Multimedia> multimedia = getMultimedia(Options.isCollectionInitializationEnabled());

/**
* A notification that this record is in some way restricted. New for GEDCOM 5.5.1. Values are supposed to be
* "confidential", "locked", or "privacy" but this implementation allows any value.
* Notes about this object
*/
protected StringWithCustomTags restrictionNotice;
protected List<Note> notes = getNotes(Options.isCollectionInitializationEnabled());

/**
* Notes about this object
* The phone numbers for this submitter
*/
protected List<Note> notes = Options.isCollectionInitializationEnabled() ? new ArrayList<Note>(0) : null;
protected List<StringWithCustomTags> phoneNumbers = getPhoneNumbers(Options.isCollectionInitializationEnabled());

/**
* The phone numbers for this submitter
* The religious affiliation of this event. New for GEDCOM 5.5.1.
*/
protected List<StringWithCustomTags> phoneNumbers = new ArrayList<StringWithCustomTags>(0);
protected StringWithCustomTags religiousAffiliation;

/**
* Web URL's. New for GEDCOM 5.5.1.
* The responsible agency for this event
*/
protected List<StringWithCustomTags> wwwUrls = new ArrayList<StringWithCustomTags>(0);
protected StringWithCustomTags respAgency;

/**
* Fax numbers. New for GEDCOM 5.5.1.
* A notification that this record is in some way restricted. New for GEDCOM 5.5.1. Values are supposed to be
* "confidential", "locked", or "privacy" but this implementation allows any value.
*/
protected List<StringWithCustomTags> faxNumbers = new ArrayList<StringWithCustomTags>(0);
protected StringWithCustomTags restrictionNotice;

/**
* The emails for this submitter. New for GEDCOM 5.5.1
* A subtype that further qualifies the type
*/
protected List<StringWithCustomTags> emails = new ArrayList<StringWithCustomTags>(0);
protected StringWithCustomTags subType;

/**
* Multimedia links for this source citation
* Web URL's. New for GEDCOM 5.5.1.
*/
protected List<Multimedia> multimedia = new ArrayList<Multimedia>(0);
protected List<StringWithCustomTags> wwwUrls = getWwwUrls(Options.isCollectionInitializationEnabled());

/**
* The citations for this object
* Either a Y or a null after the event type;
*/
protected List<AbstractCitation> citations = Options.isCollectionInitializationEnabled() ? new ArrayList<AbstractCitation>(0) : null;
protected String yNull;

/**
* {@inheritDoc}
Expand Down
16 changes: 8 additions & 8 deletions src/main/java/org/gedcom4j/model/AbstractLdsOrdinance.java
Expand Up @@ -35,34 +35,34 @@
public abstract class AbstractLdsOrdinance extends AbstractElement {

/**
* The status
* The citations for this ordinance
*/
protected StringWithCustomTags status;
protected List<AbstractCitation> citations = getCitations(Options.isCollectionInitializationEnabled());

/**
* The date
*/
protected StringWithCustomTags date;

/**
* The temple code
* The notes for this ordinance
*/
protected StringWithCustomTags temple;
protected List<Note> notes = getNotes(Options.isCollectionInitializationEnabled());

/**
* The place
*/
protected StringWithCustomTags place;

/**
* The citations for this ordinance
* The status
*/
protected List<AbstractCitation> citations = Options.isCollectionInitializationEnabled() ? getCitations(true) : null;
protected StringWithCustomTags status;

/**
* The notes for this ordinance
* The temple code
*/
protected List<Note> notes = Options.isCollectionInitializationEnabled() ? getNotes(true) : null;
protected StringWithCustomTags temple;

@Override
public boolean equals(Object obj) {
Expand Down
18 changes: 9 additions & 9 deletions src/main/java/org/gedcom4j/model/Address.java
Expand Up @@ -34,11 +34,6 @@
* @author frizbog1
*/
public class Address extends AbstractElement {
/**
* The lines of the address
*/
private List<String> lines = Options.isCollectionInitializationEnabled() ? getLines(true) : null;

/**
* Line one of the address
*/
Expand All @@ -55,19 +50,24 @@ public class Address extends AbstractElement {
private StringWithCustomTags city;

/**
* State/province
* Country
*/
private StringWithCustomTags stateProvince;
private StringWithCustomTags country;

/**
* The lines of the address
*/
private List<String> lines = getLines(Options.isCollectionInitializationEnabled());

/**
* Postal code
*/
private StringWithCustomTags postalCode;

/**
* Country
* State/province
*/
private StringWithCustomTags country;
private StringWithCustomTags stateProvince;

@Override
public boolean equals(Object obj) {
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/gedcom4j/model/AdoptedByWhichParent.java
Expand Up @@ -28,16 +28,16 @@
* @author frizbog1
*/
public enum AdoptedByWhichParent {
/**
* Both parents adopted
*/
BOTH,
/**
* The husband did the adopting
*/
HUSBAND,
/**
* The wife did the adopting
*/
WIFE,
/**
* Both parents adopted
*/
BOTH;
WIFE;
}
16 changes: 8 additions & 8 deletions src/main/java/org/gedcom4j/model/Association.java
Expand Up @@ -33,29 +33,29 @@
*/
public class Association extends AbstractElement {
/**
* Relationship description
* The type of the associated entity
*/
private StringWithCustomTags relationship;
private StringWithCustomTags associatedEntityType;

/**
* The XREF to the associated entity
*/
private String associatedEntityXref;

/**
* The type of the associated entity
* The citations for this object
*/
private StringWithCustomTags associatedEntityType;
private List<AbstractCitation> citations = getCitations(Options.isCollectionInitializationEnabled());

/**
* The citations for this object
* Notes about this object
*/
private List<AbstractCitation> citations = Options.isCollectionInitializationEnabled() ? new ArrayList<AbstractCitation>(0) : null;
private List<Note> notes = getNotes(Options.isCollectionInitializationEnabled());

/**
* Notes about this object
* Relationship description
*/
private List<Note> notes = Options.isCollectionInitializationEnabled() ? new ArrayList<Note>(0) : null;
private StringWithCustomTags relationship;

@Override
public boolean equals(Object obj) {
Expand Down
8 changes: 4 additions & 4 deletions src/main/java/org/gedcom4j/model/ChangeDate.java
Expand Up @@ -38,14 +38,14 @@ public class ChangeDate extends AbstractElement {
private StringWithCustomTags date;

/**
* The time (as a string)
* Notes about this object
*/
private StringWithCustomTags time;
private List<Note> notes = getNotes(Options.isCollectionInitializationEnabled());

/**
* Notes about this object
* The time (as a string)
*/
private List<Note> notes = Options.isCollectionInitializationEnabled() ? new ArrayList<Note>(0) : null;
private StringWithCustomTags time;

@Override
public boolean equals(Object obj) {
Expand Down
4 changes: 3 additions & 1 deletion src/main/java/org/gedcom4j/model/CitationData.java
Expand Up @@ -24,6 +24,8 @@
import java.util.ArrayList;
import java.util.List;

import org.gedcom4j.Options;

/**
* A class for source citation data.
*
Expand All @@ -38,7 +40,7 @@ public class CitationData extends AbstractElement {
/**
* The source text - one or more lines of it
*/
private List<List<String>> sourceText = new ArrayList<List<String>>(0);
private List<List<String>> sourceText = getSourceText(Options.isCollectionInitializationEnabled());

@Override
public boolean equals(Object obj) {
Expand Down

0 comments on commit 77d2e6a

Please sign in to comment.