* Create table of ContentTransformers configured in config.
* @param config configuration.
* @return transformer table
*/
public static ConcurrentHashMap<String, ContentHighlighter> getTransformerTable(final GenericConfiguration config) {
GenericConfiguration tconf = (GenericConfiguration) config.get(HIGHLIGHTER_KEY);
if (tconf != null) {
ConcurrentHashMap<String, GenericConfiguration> confs = tconf.getSubConfigs();
if (confs != null && confs.size() > 0) {
ConcurrentHashMap<String, ContentHighlighter> ret = new ConcurrentHashMap<String, ContentHighlighter>(confs.size());
for (Map.Entry<String, GenericConfiguration> e : confs.entrySet()) {
try {
GenericConfiguration c = e.getValue();
String attribute = (String) c.get(HIGHLIGHTER_ATTRIBUTE_KEY);
String highlighterClass = (String) c.get(HIGHLIGHTER_CLASS_KEY);
ContentHighlighter t = null;
t = (ContentHighlighter) Class.forName(highlighterClass)
.getConstructor(new Class[] { GenericConfiguration.class }).newInstance(c);
if (t != null && attribute != null) {
ret.put(attribute, t);