/** * Create a {@link MarkupLanguage markup language parser} for the {@link #getMarkupLanguage() * specified markup language}. * * @return the markup language * @throws BuildException if the markup language is not specified or if it is unknown. */ protected MarkupLanguage createMarkupLanguage() throws BuildException { if (markupLanguage == null) { throw new BuildException(Messages.getString("MarkupTask.0")); // $NON-NLS-1$ } try { MarkupLanguage language = ServiceLocator.getInstance(getClass().getClassLoader()).getMarkupLanguage(markupLanguage); if (internalLinkPattern != null) { checkAbstractMarkupLanguage(language, "internalLinkPattern"); // $NON-NLS-1$ ((AbstractMarkupLanguage) language).setInternalLinkPattern(internalLinkPattern); } if (markupLanguageConfiguration != null) { language.configure(markupLanguageConfiguration); } return language; } catch (IllegalArgumentException e) { throw new BuildException(e.getMessage(), e); } }