Java tutorial
/******************************************************************************* * Copyright 2015 * Center for Information, Media and Technology (ZIMT) * HAWK University for Applied Sciences and Arts Hildesheim/Holzminden/Gttingen * * This file is part of HAWK RFID Library Tools. * * HAWK RFID Library Tools is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. * * Diese Datei ist Teil von HAWK RFID Library Tools. * * HAWK RFID Library Tools ist Freie Software: Sie knnen es unter den Bedingungen * der GNU General Public License, wie von der Free Software Foundation, * Version 3 der Lizenz oder (nach Ihrer Wahl) jeder neueren * verffentlichten Version, weiterverbreiten und/oder modifizieren. * * Dieses Programm wird in der Hoffnung, dass es ntzlich sein wird, aber * OHNE JEDE GEWHRLEISTUNG, bereitgestellt; sogar ohne die implizite * Gewhrleistung der MARKTFHIGKEIT oder EIGNUNG FR EINEN BESTIMMTEN ZWECK. * Siehe die GNU General Public License fr weitere Details. * * Sie sollten eine Kopie der GNU General Public License zusammen mit diesem * Programm erhalten haben. Wenn nicht, siehe <http://www.gnu.org/licenses/>. *******************************************************************************/ package org.objectspace.rfid; import org.apache.commons.configuration2.AbstractConfiguration; import org.objectspace.rfid.elatec.ElatecRFID; import org.objectspace.rfid.elatec.ISO15693Elatec; import org.objectspace.rfid.feig.FeigRFID; import org.objectspace.rfid.feig.ISO15693Feig; import org.objectspace.rfid.library.ISO15693Reader; /** * @author Juergen Enge * */ public class ISO15693ReaderFactory { /** * */ public ISO15693ReaderFactory() { } public static ISO15693Reader createReader(AbstractConfiguration config) throws Exception { String reader = config.getString("device.select"); switch (reader) { case "feig": return new ISO15693Feig(config); case "elatec": return new ISO15693Elatec(config); default: throw new Exception("unknow reader: " + reader); } } }