while( labelIterator.hasNext() ) {
SourceBean label = (SourceBean)labelIterator.next();
String position = (String)label.getAttribute("position");
String clazz = (String)label.getAttribute("class_name");
ILabelProducer labelProducer = null;
try {
labelProducer = (ILabelProducer) Class.forName(clazz).newInstance();
} catch (InstantiationException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ClassNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
if(labelProducer != null) {
labelProducer.init(label);
labelProducers.put(position, labelProducer);
}
}
return labelProducers;