001 /**
002 * Copyright (C) 2007-2011, Jens Lehmann
003 *
004 * This file is part of DL-Learner.
005 *
006 * DL-Learner is free software; you can redistribute it and/or modify
007 * it under the terms of the GNU General Public License as published by
008 * the Free Software Foundation; either version 3 of the License, or
009 * (at your option) any later version.
010 *
011 * DL-Learner is distributed in the hope that it will be useful,
012 * but WITHOUT ANY WARRANTY; without even the implied warranty of
013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
014 * GNU General Public License for more details.
015 *
016 * You should have received a copy of the GNU General Public License
017 * along with this program. If not, see <http://www.gnu.org/licenses/>.
018 */
019
020 package org.dllearner.core.configurators;
021
022 import java.net.URL;
023 import org.dllearner.core.ComponentManager;
024 import org.dllearner.kb.KBFile;
025
026 /**
027 * automatically generated, do not edit manually.
028 * run org.dllearner.scripts.ConfigJavaGenerator to update
029 **/
030 public class KBFileConfigurator implements Configurator {
031
032 private boolean reinitNecessary = false;
033 private KBFile kBFile;
034
035 /**
036 * @param kBFile see KBFile
037 **/
038 public KBFileConfigurator(KBFile kBFile){
039 this.kBFile = kBFile;
040 }
041
042 /**
043 * @return KBFile
044 **/
045 public static KBFile getKBFile() {
046 KBFile component = ComponentManager.getInstance().knowledgeSource(KBFile.class);
047 return component;
048 }
049
050 /**
051 * url URL pointer to the KB file.
052 * mandatory: false| reinit necessary: true
053 * default value: null
054 * @return URL
055 **/
056 public URL getUrl() {
057 return (URL) ComponentManager.getInstance().getConfigOptionValue(kBFile, "url") ;
058 }
059
060 /**
061 * @param url URL pointer to the KB file.
062 * mandatory: false| reinit necessary: true
063 * default value: null
064 **/
065 public void setUrl(URL url) {
066 ComponentManager.getInstance().applyConfigEntry(kBFile, "url", url);
067 reinitNecessary = true;
068 }
069
070 /**
071 * true, if this component needs reinitializsation.
072 * @return boolean
073 **/
074 public boolean isReinitNecessary(){
075 return reinitNecessary;
076 }
077
078
079 }