Created
April 19, 2012 02:09
-
-
Save i386/2417878 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void initialiseTaskExecutables(final Plugin plugin, final Element element) | |
{ | |
@SuppressWarnings({"unchecked"}) | |
final List<Element> executableElements = element.elements("executable"); | |
if (executableElements != null && !executableElements.isEmpty()) | |
{ | |
final Element executableElement = Iterables.getFirst(executableElements, null); | |
if (executableElement != null) | |
{ | |
final Attribute key = executableElement.attribute("key"); | |
if (key != null && StringUtils.isNotEmpty(key.getValue())) | |
{ | |
final Attribute nameKey = executableElement.attribute("nameKey"); | |
final Attribute pathHelpKey = executableElement.attribute("pathHelpKey"); | |
final Attribute primaryCapabilityProvider = executableElement.attribute("primaryCapabilityProvider"); | |
taskExecutables.add(new TaskExecutableTypeImpl(key, nameKey, pathHelpKey, primaryCapabilityProvider)); | |
} | |
else | |
{ | |
log.warn("Task Type Module (" + getKey() + ") of plugin " + plugin.getKey() | |
+ " contains an incorrectly configured 'executable'" | |
+ " element. Please use the 'key' attribute to define your" | |
+ " unique executable key"); | |
} | |
} | |
if (executableElements.size() > 1) | |
{ | |
log.warn("Task Type Module (" + getKey() + ") of plugin " + plugin.getKey() + " specifies more than one 'executable' element which is not supported at this time"); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment