/** * Returns a shared XML parser. * * @return an XML parser * @throws CoreException if unable to create a parser * @since 3.0 */ public static DocumentBuilder getParser() throws CoreException { if (fgXMLParser == null) { try { fgXMLParser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); fgXMLParser.setErrorHandler(new DefaultHandler()); } catch (ParserConfigurationException e) { abort(LaunchingMessages.LaunchingPlugin_34, e); } catch (FactoryConfigurationError e) { abort(LaunchingMessages.LaunchingPlugin_34, e); } } return fgXMLParser; }
/** * Returns a shared XML parser. * * @return an XML parser * @throws CoreException if unable to create a parser * @since 3.0 */ public static DocumentBuilder getParser() throws CoreException { if (fgXMLParser == null) { try { fgXMLParser = DocumentBuilderFactory.newInstance().newDocumentBuilder(); fgXMLParser.setErrorHandler(new DefaultHandler()); } catch (ParserConfigurationException e) { abort(LaunchingMessages.LaunchingPlugin_34, e); } catch (FactoryConfigurationError e) { abort(LaunchingMessages.LaunchingPlugin_34, e); } } return fgXMLParser; }
/** * Returns a new runtime classpath entry of the specified type. * * @param id extension type id * @return new uninitialized runtime classpath entry * @throws CoreException if unable to create an entry */ public IRuntimeClasspathEntry2 newRuntimeClasspathEntry(String id) throws CoreException { if (fClasspathEntryExtensions == null) { initializeRuntimeClasspathExtensions(); } IConfigurationElement config = fClasspathEntryExtensions.get(id); if (config != null) { return (IRuntimeClasspathEntry2) config.createExecutableExtension("class"); //$NON-NLS-1$ } abort(NLS.bind(LaunchingMessages.LaunchingPlugin_32, new String[]{id}), null); return null; }
/** * Returns a new runtime classpath entry of the specified type. * * @param id extension type id * @return new uninitialized runtime classpath entry * @throws CoreException if unable to create an entry */ public IRuntimeClasspathEntry2 newRuntimeClasspathEntry(String id) throws CoreException { if (fClasspathEntryExtensions == null) { initializeRuntimeClasspathExtensions(); } IConfigurationElement config = fClasspathEntryExtensions.get(id); if (config != null) { return (IRuntimeClasspathEntry2) config.createExecutableExtension("class"); //$NON-NLS-1$ } abort(NLS.bind(LaunchingMessages.LaunchingPlugin_32, new String[]{id}), null); return null; }