public Object end(String uri,
String localName,
ExtensibleXmlParser parser) throws SAXException {
final Element element = parser.endElementBuilder();
final ChangeSetImpl changeSet = (ChangeSetImpl) parser.getParent();
Collection<Resource> removedResources = new ArrayList<Resource>();
Collection<String> removedDefinitions = new ArrayList<String>();
for (Object object : ( Collection ) parser.getCurrent()) {
if (object instanceof DefinitionHandler.DefinitionHandlerData){
DefinitionHandler.DefinitionHandlerData data = (DefinitionHandler.DefinitionHandlerData)object;
String fullName = data.getPackageName();
if (fullName == null || fullName.equals("")){
fullName = data.getName();
}else{
fullName += "."+data.getName();
}
removedDefinitions.add(fullName);
}else if (object instanceof Resource){
removedResources.add((Resource)object);
}
}
changeSet.setResourcesRemoved( removedResources );
changeSet.setKnowledgeDefinitionsRemoved( removedDefinitions );
return ( Collection ) parser.getCurrent();
}