Created
May 26, 2016 22:08
-
-
Save authsec/e22413482d704181efb956d51bfb8ecc 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
package org.coffeecrew.tutorials.simplepluginmechanism; | |
import java.util.Collection; | |
import org.openide.util.Lookup; | |
public class SimplePhaseExecutor { | |
public static void main(String[] args) { | |
String processingToken = ""; | |
for (final Phase p : Phase.values()) { | |
final Collection<? extends Plugin> processables = Lookup.getDefault().lookupAll(p.getPhaseInterface()); | |
for (final Plugin plugin : processables) { | |
processingToken = plugin.process(processingToken); | |
} | |
} | |
System.out.println(processingToken); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment