User: dallan Date: 1/3/12 don't make this a SourceCitationContainer, because that would allow notes within note refs
| 26 | * don't make this a SourceCitationContainer, because that would allow notes within note refs |
| 27 | */ |
| 28 | public class NoteRef extends ExtensionContainer { |
| 29 | private String ref = null; |
| 30 | private List<SourceCitation> sourceCitations = null; |
| 31 | |
| 32 | public String getRef() { |
| 33 | return ref; |
| 34 | } |
| 35 | |
| 36 | public void setRef(String ref) { |
| 37 | this.ref = ref; |
| 38 | } |
| 39 | |
| 40 | /** |
| 41 | * Convenience function to dereference note |
| 42 | * @param gedcom Gedcom |
| 43 | * @return referenced note |
| 44 | */ |
| 45 | public Note getNote(Gedcom gedcom) { |
| 46 | return gedcom.getNote(ref); |
| 47 | } |
| 48 | |
| 49 | public List<SourceCitation> getSourceCitations() { |
| 50 | return sourceCitations != null ? sourceCitations : Collections.<SourceCitation>emptyList(); |
| 51 | } |
| 52 | |
| 53 | public void setSourceCitations(List<SourceCitation> sourceCitations) { |
| 54 | this.sourceCitations = sourceCitations; |
| 55 | } |
| 56 | |
| 57 | public void addSourceCitation(SourceCitation sourceCitation) { |
| 58 | if (sourceCitations == null) { |
| 59 | sourceCitations = new ArrayList<SourceCitation>(); |
| 60 | } |
| 61 | sourceCitations.add(sourceCitation); |
| 62 | } |
| 63 | |
| 64 | public void accept(Visitor visitor) { |
| 65 | if (visitor.visit(this)) { |
| 66 | for (SourceCitation sourceCitation : getSourceCitations()) { |
| 67 | sourceCitation.accept(visitor); |
| 68 | } |
| 69 | super.visitContainedObjects(visitor); |
| 70 | visitor.endVisit(this); |
| 71 | } |
| 72 | } |
| 73 | } |
nothing calls this directly
no outgoing calls
no test coverage detected