| 1 | /* |
|---|
| 2 | * This program is free software; you can redistribute it and/or modify |
|---|
| 3 | * it under the terms of the GNU General Public License as published by |
|---|
| 4 | * the Free Software Foundation; either version 2 of the License, or |
|---|
| 5 | * (at your option) any later version. |
|---|
| 6 | * |
|---|
| 7 | * This program is distributed in the hope that it will be useful, |
|---|
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|---|
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|---|
| 10 | * GNU General Public License for more details. |
|---|
| 11 | * |
|---|
| 12 | * You should have received a copy of the GNU General Public License |
|---|
| 13 | * along with this program; if not, write to the Free Software |
|---|
| 14 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. |
|---|
| 15 | */ |
|---|
| 16 | |
|---|
| 17 | /* |
|---|
| 18 | * LibrarySerialization.java |
|---|
| 19 | * Copyright (C) 2006 University of Waikato, Hamilton, New Zealand |
|---|
| 20 | */ |
|---|
| 21 | |
|---|
| 22 | package weka.gui.ensembleLibraryEditor; |
|---|
| 23 | |
|---|
| 24 | import weka.core.xml.XMLBasicSerialization; |
|---|
| 25 | |
|---|
| 26 | /** |
|---|
| 27 | * For serializing LibraryModels. This class uses the existing weka |
|---|
| 28 | * infrastructure to let us easily serialize classifier specifications |
|---|
| 29 | * in a nice solid and stable XML format. This class is responsible for |
|---|
| 30 | * creating the .model.xml files. Note that this truly was a life saver |
|---|
| 31 | * when we found out that saving the string representations , e.g. |
|---|
| 32 | * "weka.classifiers.meta.foobar -X 1 -Y 2" in a flat file simply did |
|---|
| 33 | * not work for lots of different kinds of classifiers. |
|---|
| 34 | * |
|---|
| 35 | * @author fracpete (fracpete at waikato dot ac dot nz) |
|---|
| 36 | * @version $Revision: 5928 $ |
|---|
| 37 | */ |
|---|
| 38 | public class LibrarySerialization |
|---|
| 39 | extends XMLBasicSerialization { |
|---|
| 40 | |
|---|
| 41 | /** |
|---|
| 42 | * initializes the serialization |
|---|
| 43 | * |
|---|
| 44 | * @throws Exception if initialization fails |
|---|
| 45 | */ |
|---|
| 46 | public LibrarySerialization() throws Exception { |
|---|
| 47 | super(); |
|---|
| 48 | } |
|---|
| 49 | |
|---|
| 50 | /** |
|---|
| 51 | * generates internally a new XML document and clears also the IgnoreList and |
|---|
| 52 | * the mappings for the Read/Write-Methods |
|---|
| 53 | * |
|---|
| 54 | * @throws Exception if something goes wrong |
|---|
| 55 | */ |
|---|
| 56 | public void clear() throws Exception { |
|---|
| 57 | super.clear(); |
|---|
| 58 | |
|---|
| 59 | // allow |
|---|
| 60 | m_Properties.addAllowed(weka.classifiers.Classifier.class, "options"); |
|---|
| 61 | } |
|---|
| 62 | } |
|---|