int attrCount = serviceItem.attributeSets.length;
Entry[] attr = serviceItem.attributeSets;
List<UIDescriptor> list = new ArrayList<UIDescriptor>();
for(int i = 0; i < attrCount; ++i) {
if(attr[i] instanceof UIDescriptor) {
UIDescriptor desc = (UIDescriptor)attr[i];
if(desc.attributes == null) {
continue;
}
for (Object attribute : desc.attributes) {
if (attribute instanceof UIFactoryTypes) {
// Should also look through required packages here
list.add(desc);
}
}
}
}
List factoryList = new ArrayList();
for (UIDescriptor desc : list) {
Object uiFactory;
try {
uiFactory = desc.getUIFactory(serviceItem.service
.getClass().getClassLoader());
factoryList.add(uiFactory);
} catch (ClassNotFoundException cnfe) {
System.out.println(
"Class not found. Could not unmarshall " +