| Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
| ModuleClassFile |
|
| 1.0;1 |
| 1 | package org.jtheque.core.managers.module.loaders; | |
| 2 | ||
| 3 | /* | |
| 4 | * This file is part of JTheque. | |
| 5 | * | |
| 6 | * JTheque is free software: you can redistribute it and/or modify | |
| 7 | * it under the terms of the GNU General Public License as published by | |
| 8 | * the Free Software Foundation, either version 3 of the License. | |
| 9 | * | |
| 10 | * JTheque is distributed in the hope that it will be useful, | |
| 11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
| 13 | * GNU General Public License for more details. | |
| 14 | * | |
| 15 | * You should have received a copy of the GNU General Public License | |
| 16 | * along with JTheque. If not, see <http://www.gnu.org/licenses/>. | |
| 17 | */ | |
| 18 | ||
| 19 | import java.io.File; | |
| 20 | import java.net.URL; | |
| 21 | import java.util.ArrayList; | |
| 22 | import java.util.Collection; | |
| 23 | ||
| 24 | /** | |
| 25 | * A module class file. | |
| 26 | * | |
| 27 | * @author Baptiste Wicht | |
| 28 | */ | |
| 29 | final class ModuleClassFile { | |
| 30 | private File file; | |
| 31 | private String moduleContext; | |
| 32 | private final Collection<URL> resources; | |
| 33 | ||
| 34 | /** | |
| 35 | * Construct a new ModuleClassFile. | |
| 36 | */ | |
| 37 | ModuleClassFile() { | |
| 38 | 0 | super(); |
| 39 | ||
| 40 | 0 | resources = new ArrayList<URL>(10); |
| 41 | 0 | } |
| 42 | ||
| 43 | /** | |
| 44 | * Return the file. | |
| 45 | * | |
| 46 | * @return The file. | |
| 47 | */ | |
| 48 | public File getFile() { | |
| 49 | 0 | return file; |
| 50 | } | |
| 51 | ||
| 52 | /** | |
| 53 | * Set the file. | |
| 54 | * | |
| 55 | * @param file The file. | |
| 56 | */ | |
| 57 | public void setFile(File file) { | |
| 58 | 0 | this.file = file; |
| 59 | 0 | } |
| 60 | ||
| 61 | /** | |
| 62 | * Return the context of the module. | |
| 63 | * | |
| 64 | * @return The module context. | |
| 65 | */ | |
| 66 | public String getModuleContext() { | |
| 67 | 0 | return moduleContext; |
| 68 | } | |
| 69 | ||
| 70 | /** | |
| 71 | * Set the module context. | |
| 72 | * | |
| 73 | * @param moduleContext The module context. | |
| 74 | */ | |
| 75 | public void setModuleContext(String moduleContext) { | |
| 76 | 0 | this.moduleContext = moduleContext; |
| 77 | 0 | } |
| 78 | ||
| 79 | /** | |
| 80 | * Return all the resources of the module class file. | |
| 81 | * | |
| 82 | * @return A List containing all the resources of the module. | |
| 83 | */ | |
| 84 | public Collection<URL> getResources() { | |
| 85 | 0 | return resources; |
| 86 | } | |
| 87 | ||
| 88 | @Override | |
| 89 | public String toString() { | |
| 90 | 0 | return "ModuleClassFile{" + |
| 91 | "file=" + file + | |
| 92 | ", moduleContext='" + moduleContext + '\'' + | |
| 93 | ", resources=" + resources + | |
| 94 | '}'; | |
| 95 | } | |
| 96 | } |