diff options
author | Noel Grandin <noel@peralex.com> | 2013-05-03 15:03:19 +0200 |
---|---|---|
committer | Noel Grandin <noel@peralex.com> | 2013-05-06 11:45:53 +0200 |
commit | 8be40d31d78723debd47f671544f480c1c606db7 (patch) | |
tree | 0051888bb41793e4d65704a93a4cfc659119c8bc /javaunohelper/com/sun | |
parent | e527a340051b55a6f05d05f397d82ec797165163 (diff) |
Java cleanup, convert Hashtable to HashMap
Change-Id: If8a9c0c3a4b357fb9c0ff096f44ed1b44ebbcef4
Diffstat (limited to 'javaunohelper/com/sun')
-rw-r--r-- | javaunohelper/com/sun/star/comp/helper/Bootstrap.java | 22 | ||||
-rw-r--r-- | javaunohelper/com/sun/star/comp/helper/ComponentContext.java | 9 |
2 files changed, 27 insertions, 4 deletions
diff --git a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java index 989e283853b0..85bc4837a99d 100644 --- a/javaunohelper/com/sun/star/comp/helper/Bootstrap.java +++ b/javaunohelper/com/sun/star/comp/helper/Bootstrap.java @@ -89,13 +89,21 @@ public class Bootstrap { "com.sun.star.comp.connections.Acceptor", null, null, null ) ); } + /** + * backwards compatibility stub. + */ + static public XComponentContext createInitialComponentContext( Hashtable<String, Object> context_entries ) + throws Exception + { + return createInitialComponentContext((java.util.Map<String,Object>)context_entries); + } /** Bootstraps an initial component context with service manager and basic jurt components inserted. @param context_entries the hash table contains mappings of entry names (type string) to context entries (type class ComponentContextEntry). @return a new context. */ - static public XComponentContext createInitialComponentContext( Hashtable<String, Object> context_entries ) + static public XComponentContext createInitialComponentContext( java.util.Map<String, Object> context_entries ) throws Exception { ServiceManager xSMgr = new ServiceManager(); @@ -148,6 +156,16 @@ public class Bootstrap { { return defaultBootstrap_InitialComponentContext( null, null ); } + /** + * Backwards compatibility stub. + */ + static public final XComponentContext defaultBootstrap_InitialComponentContext( + String ini_file, Hashtable<String,String> bootstrap_parameters ) + throws Exception + { + return defaultBootstrap_InitialComponentContext(ini_file, (java.util.Map<String,String>)bootstrap_parameters); + + } /** Bootstraps the initial component context from a native UNO installation. @param ini_file @@ -158,7 +176,7 @@ public class Bootstrap { @see "cppuhelper/defaultBootstrap_InitialComponentContext()" */ static public final XComponentContext defaultBootstrap_InitialComponentContext( - String ini_file, Hashtable<String,String> bootstrap_parameters ) + String ini_file, java.util.Map<String,String> bootstrap_parameters ) throws Exception { // jni convenience: easier to iterate over array than calling Hashtable diff --git a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java index c47d623dcfa8..0b3b1948acd2 100644 --- a/javaunohelper/com/sun/star/comp/helper/ComponentContext.java +++ b/javaunohelper/com/sun/star/comp/helper/ComponentContext.java @@ -58,7 +58,7 @@ public class ComponentContext implements XComponentContext, XComponent private static final String SMGR_NAME = "/singletons/com.sun.star.lang.theServiceManager"; private static final String TDMGR_NAME = "/singletons/com.sun.star.reflection.theTypeDescriptionManager"; - private Hashtable<String,Object> m_table; + private java.util.Map<String,Object> m_table; private XComponentContext m_xDelegate; private XMultiComponentFactory m_xSMgr; @@ -66,6 +66,11 @@ public class ComponentContext implements XComponentContext, XComponent private ArrayList<XEventListener> m_eventListener; + public ComponentContext( Hashtable<String,Object> table, XComponentContext xDelegate ) + { + this((java.util.Map<String,Object>)table, xDelegate); + } + /** Ctor to create a component context passing a hashtable for values and a delegator reference. Entries of the passed hashtable are either direct values or ComponentContextEntry objects. @@ -75,7 +80,7 @@ public class ComponentContext implements XComponentContext, XComponent @param xDelegate if values are not found, request is delegated to this object */ - public ComponentContext( Hashtable<String,Object> table, XComponentContext xDelegate ) + public ComponentContext( java.util.Map<String,Object> table, XComponentContext xDelegate ) { m_eventListener = new ArrayList<XEventListener>(); m_table = table; |