2 * This file is part of the Vamsas Client version 0.1.
\r
3 * Copyright 2009 by Jim Procter, Iain Milne, Pierre Marguerite,
\r
4 * Andrew Waterhouse and Dominik Lindner.
\r
6 * Earlier versions have also been incorporated into Jalview version 2.4
\r
7 * since 2008, and TOPALi version 2 since 2007.
\r
9 * The Vamsas Client is free software: you can redistribute it and/or modify
\r
10 * it under the terms of the GNU Lesser General Public License as published by
\r
11 * the Free Software Foundation, either version 3 of the License, or
\r
12 * (at your option) any later version.
\r
14 * The Vamsas Client is distributed in the hope that it will be useful,
\r
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
\r
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
\r
17 * GNU Lesser General Public License for more details.
\r
19 * You should have received a copy of the GNU Lesser General Public License
\r
20 * along with the Vamsas Client. If not, see <http://www.gnu.org/licenses/>.
\r
22 package uk.ac.vamsas.objects.utils;
\r
24 import uk.ac.vamsas.objects.core.*;
\r
25 import uk.ac.vamsas.objects.utils.document.VersionEntries;
\r
28 * various vamsas-client independent helpers for creating and manipulating the
\r
29 * vamsasDocument Vobject
\r
34 public class DocumentStuff {
\r
35 public static VamsasDocument newVamsasDocument(VAMSAS root[], String version) {
\r
36 return newVamsasDocument(root, ProvenanceStuff.newProvenance(
\r
37 "AUTO:org.vamsas.DocumentStuff.newVamsasDocument",
\r
38 "Vamsas Document created"), version);
\r
41 public static VamsasDocument newVamsasDocument(VAMSAS root[]) {
\r
42 return newVamsasDocument(root, ProvenanceStuff.newProvenance(
\r
43 "AUTO:org.vamsas.DocumentStuff.newVamsasDocument",
\r
44 "Vamsas Document created"), VersionEntries.latestVersion());
\r
47 public static VamsasDocument newVamsasDocument(VAMSAS root[], Provenance p,
\r
49 VamsasDocument doc = new VamsasDocument();
\r
50 for (int r = 0; r < root.length; r++) {
\r
51 doc.addVAMSAS(root[r]);
\r
53 doc.setProvenance(p);
\r
54 doc.setVersion(version);
\r