throw new MagicParseException("unable to instantiate parser", e2); //$NON-NLS-1$ throw new MagicParseException("couldn't load '" + magicURL + "'"); //$NON-NLS-1$ //$NON-NLS-2$ throw new MagicParseException("Parse error occurred: " + e); //$NON-NLS-1$
parser = XMLReaderFactory.createXMLReader(DEFAULT_PARSER_NAME); } catch (Exception ee) { throw new MagicParseException("unable to instantiate parser"); throw new MagicParseException("couldn't load '" + magicURL + "'"); throw new MagicParseException("parse error occurred - " + e.getMessage());
/** * return the parsed MagicMatch objects that were created from the magic.xml * definitions * * @return the parsed MagicMatch objects * * @throws MagicParseException DOCUMENT ME! */ public static Collection<MagicMatcher> getMatchers() throws MagicParseException { log.debug("getMatchers()"); if (!initialized) { initialize(); } Iterator<MagicMatcher> i = magicParser.getMatchers().iterator(); List<MagicMatcher> m = new ArrayList<MagicMatcher>(); while (i.hasNext()) { MagicMatcher matcher = (MagicMatcher) i.next(); try { m.add(matcher.clone()); } catch (CloneNotSupportedException e) { log.error("failed to clone matchers"); throw new MagicParseException("failed to clone matchers"); } } return m; }
parser = XMLReaderFactory.createXMLReader(DEFAULT_PARSER_NAME); } catch (Exception ee) { throw new MagicParseException("unable to instantiate parser"); throw new MagicParseException("couldn't load '" + magicURL + "'"); throw new MagicParseException("parse error occurred - " + e.getMessage());
/** * return the parsed MagicMatch objects that were created from the magic.xml * definitions * * @return the parsed MagicMatch objects * * @throws MagicParseException DOCUMENT ME! */ public static Collection getMatchers() throws MagicParseException { log.debug("getMatchers()"); if (!initialized) { initialize(); } Iterator i = magicParser.getMatchers().iterator(); ArrayList m = new ArrayList(); while (i.hasNext()) { MagicMatcher matcher = (MagicMatcher) i.next(); try { m.add(matcher.clone()); } catch (CloneNotSupportedException e) { log.error("failed to clone matchers"); throw new MagicParseException("failed to clone matchers"); } } return m; }