/** Create a parser and initialize it. */ public static synchronized void initialize() throws MagicParseException { if (!initialized) { magicParser = new MagicParser(); magicParser.initialize(); // build hint map final Iterator<MagicMatcher> i = magicParser.getMatchers().iterator(); while (i.hasNext()) { final MagicMatcher matcher = i.next(); final String ext = matcher.getMatch().getExtension(); if (ext != null && !ext.trim().equals("")) { //$NON-NLS-1$ addHint(ext, matcher); } else if (matcher.getMatch().getType().equals("detector")) { //$NON-NLS-1$ final String[] exts = matcher.getDetectorExtensions(); for (final String ext2 : exts) { addHint(ext2, matcher); } } } initialized = true; } }