Needed to add special class loading, too
[Mograsim.git] / net.mograsim.logic.model / src / net / mograsim / logic / model / serializing / ResourceLoader.java
1 package net.mograsim.logic.model.serializing;
2
3 import java.io.IOException;
4 import java.io.InputStream;
5
6 import net.mograsim.logic.model.model.components.GUIComponent;
7
8 /**
9  * For loading JSON {@link GUIComponent}s from other OSGI-Modules or jar-Files.
10  * <p>
11  * An implementation must conform to either of the following rules:
12  * <ul>
13  * <li>A ResourceLoader class can be referenced directly in <code>resource:qualifiedClassName:jsonResourcePath</code> and is then
14  * instantiated using the public default constructor.</li>
15  * <li>A class referenced in <code>resource:qualifiedClassName:jsonResourcePath</code> provides a public static method called
16  * <b><code>resourceLoader</code></b> that returns an (non-null) object of the type {@link ResourceLoader}</li>
17  * </ul>
18  *
19  */
20 public interface ResourceLoader
21 {
22         InputStream loadResource(String path) throws IOException;
23
24         Class<?> loadClass(String name) throws ClassNotFoundException;
25 }