我有一個問題,我無法解決。 我瞭解春分變換,我無法解決這個麻煩,我激活我把這段代碼:Equinox轉換激活器
Properties properties = new Properties();
properties.put("equinox.transformerType", "xslt"); //$NON-NLS-1$ //$NON-NLS-2$
registration = context.registerService(URL.class.getName(), context.getBundle().getEntry("/transform.csv"), properties); //$NON-NLS-1$
但是Eclipse告訴我,registerService方法不能與參數一起使用(String,Url,Properties),它只接受(String,Url,Dictionary)。 Equinox_Transforms中的示例使用與我使用的方法相同的方法,但在這些情況下它可以正常工作。
有什麼問題?
我改變示例代碼在我的激活與此:
Dictionary properties = new Hashtable();
properties.put("equinox.transformerType", "xslt");
registration = context.registerService(URL.class.getName(), context.getBundle().getEntry("/transform.csv"), properties);
是不是?
我正在使用java.util.Properties –
嗯...我假設上下文對象是一個BundleContext? – katsharp
是的。是。我所做的只是將Equinox示例中的所有代碼複製到Activator中。有趣的是,這個例子在運行時給了我一個錯誤,但之前沒有。 –