use of org.eclipse.linuxtools.internal.oprofile.core.model.OpModelImage in project linuxtools by eclipse.
the class DependentProcessor method reset.
@Override
public void reset(Object callData) {
image = new OpModelImage();
imageList = new ArrayList<>();
}
use of org.eclipse.linuxtools.internal.oprofile.core.model.OpModelImage in project linuxtools by eclipse.
the class DependentProcessor method endElement.
@Override
public void endElement(String name, Object callData) {
if (name.equals(IMAGE_TAG)) {
imageList.add(image);
image = new OpModelImage();
} else if (name.equals(SYMBOLS_TAG)) {
image.setSymbols(_symbolsProcessor.getSymbols());
} else if (name.equals(DEPENDENT_TAG)) {
OprofileSAXHandler.getInstance(callData).pop(DEPENDENT_TAG);
}
}
use of org.eclipse.linuxtools.internal.oprofile.core.model.OpModelImage in project linuxtools by eclipse.
the class TestingOpModelEvent2 method getNewImage.
@Override
protected OpModelImage getNewImage() {
/* this code mostly taken from OpxmlRunner */
OpModelImage parsedImage = null;
try {
XMLReader reader = null;
parsedImage = new OpModelImage();
ModelDataProcessor.CallData image = new ModelDataProcessor.CallData(parsedImage);
OprofileSAXHandler handler = OprofileSAXHandler.getInstance(image);
// Create XMLReader
SAXParserFactory factory = SAXParserFactory.newInstance();
reader = factory.newSAXParser().getXMLReader();
// Set content/error handlers
reader.setContentHandler(handler);
reader.setErrorHandler(handler);
String filePath = FileLocator.toFileURL(FileLocator.find(TestPlugin.getDefault().getBundle(), new Path(REL_PATH_TO_TEST_XML), null)).getFile();
reader.parse(new InputSource(new FileReader(filePath)));
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
} catch (SAXException e) {
e.printStackTrace();
} catch (ParserConfigurationException e) {
e.printStackTrace();
}
return parsedImage;
}
Aggregations