Skip to content

Commit 8624ba6

Browse files
committed
Add a registerConstants() method.
1 parent e922632 commit 8624ba6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/org/geekden/servoy/ptk/AbstractScriptObject.java

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import java.util.Map;
2828
import java.util.Set;
2929

30+
import com.servoy.j2db.scripting.IConstantsObject;
3031
import com.servoy.j2db.scripting.IScriptObject;
3132

3233
/**
@@ -67,8 +68,8 @@ public abstract class AbstractScriptObject implements IScriptObject
6768

6869
private final Map<String, MethodInfo> methods =
6970
new HashMap<String, MethodInfo>();
70-
private final Set<Class<? extends IScriptObject>> types =
71-
new HashSet<Class<? extends IScriptObject>>();
71+
@SuppressWarnings("rawtypes")
72+
private final Set<Class> types = new HashSet<Class>();
7273

7374
private boolean annotatedMethodsRegistered = false;
7475

@@ -99,6 +100,14 @@ public final boolean isDeprecated(String method)
99100
protected void register(Class<? extends IScriptObject> clazz)
100101
{ types.add(clazz); }
101102

103+
/**
104+
* Registers {@linkplain IConstantsObject constants}. Call from the constructor.
105+
*
106+
* @param clazz the IConstantsObject implementation to be exported.
107+
*/
108+
protected void registerConstants(Class<? extends IConstantsObject> clazz)
109+
{ types.add(clazz); }
110+
102111
private void register(MethodInfo m)
103112
{ methods.put(m.name(), m); }
104113

0 commit comments

Comments
 (0)