]> gerrit.simantics Code Review - simantics/platform.git/blob - bundles/org.simantics.scl.reflection/src/org/simantics/scl/reflection/internal/registry/ExternalClass.java
Externalize strings in org.simantics.export.ui
[simantics/platform.git] / bundles / org.simantics.scl.reflection / src / org / simantics / scl / reflection / internal / registry / ExternalClass.java
1 package org.simantics.scl.reflection.internal.registry;
2
3 import org.osgi.framework.Bundle;
4
5 public class ExternalClass {
6     public final Bundle bundle;
7     public final String className;
8     public final String alternativeName;
9     
10     public ExternalClass(Bundle bundle, String className, String alternativeName) {
11         this.bundle = bundle;
12         this.className = className;
13         this.alternativeName = alternativeName;
14     }
15
16     public Class<?> loadClass() {
17         try {
18             return bundle.loadClass(className);
19         } catch (ClassNotFoundException e) {
20             return null;
21         }   
22     }    
23 }