The API should hopefully be intuitive. It can read a PharmML document,
write a DOM to a PharmML document, create a stub DOM and validate a DOM.
Some usage examples are contained in the contrib directory. Below are
code snippets showing the basic operations provided by the API.
To get an instance of the APIILibPharmML libPharmML = PharmMlFactory.getInstance().createLibPharmML();
To read the DOMInputStream in = new FileInputStream("examples/example3.xml")
IPharmMLResource resource = libPharmML.createDomFromResource(in);
in.close;
PharmML dom = res.getDom();
To write
IPharmMLResource resource = .....
OutputStream os = new FileOutputStream(aFile);
libPharmML.save(os, resource);
os.close();
To createIPharmMLResource resource = libPharmML.createDom(PharmMLVersion.0_6);
PharmML dom = resource.getDom();
To validateIPharmMLResource resource = .....
IPharmMLValidator validator = libPharmML.getValidator();
IValidationReport rpt = validator.createValidationReport(resource);
|