*
*/
public class MetainfoParser {
public Metainfo parse(InputStream metainfoStream) throws IOException {
Digester digester = new Digester();
digester.setValidating(false);
digester.addObjectCreate("metainfo", Metainfo.class);
digester.addBeanPropertySetter("metainfo/schemaVersion");
digester.addObjectCreate("*/service", Service.class);
digester.addBeanPropertySetter("*/service/name");
digester.addBeanPropertySetter("*/service/comment");
digester.addBeanPropertySetter("*/service/version");
digester.addObjectCreate("*/commandOrder", CommandOrder.class);
digester.addBeanPropertySetter("*/commandOrder/command");
digester.addBeanPropertySetter("*/commandOrder/requires");
digester.addSetNext("*/commandOrder", "addCommandOrder");
digester.addObjectCreate("*/exportGroup", ExportGroup.class);
digester.addBeanPropertySetter("*/exportGroup/name");
digester.addObjectCreate("*/export", Export.class);
digester.addBeanPropertySetter("*/export/name");
digester.addBeanPropertySetter("*/export/value");
digester.addSetNext("*/export", "addExport");
digester.addSetNext("*/exportGroup", "addExportGroup");
digester.addObjectCreate("*/component", Component.class);
digester.addBeanPropertySetter("*/component/name");
digester.addBeanPropertySetter("*/component/category");
digester.addBeanPropertySetter("*/component/publishConfig");
digester.addBeanPropertySetter("*/component/minInstanceCount");
digester.addBeanPropertySetter("*/component/maxInstanceCount");
digester.addSetNext("*/component", "addComponent");
digester.addObjectCreate("*/commandScript", CommandScript.class);
digester.addBeanPropertySetter("*/commandScript/script");
digester.addBeanPropertySetter("*/commandScript/scriptType");
digester.addBeanPropertySetter("*/commandScript/timeout");
digester.addSetNext("*/commandScript", "addCommandScript");
digester.addObjectCreate("*/osSpecific", OSSpecific.class);
digester.addBeanPropertySetter("*/osSpecific/osType");
digester.addObjectCreate("*/package", OSPackage.class);
digester.addBeanPropertySetter("*/package/type");
digester.addBeanPropertySetter("*/package/name");
digester.addSetNext("*/package", "addOSPackage");
digester.addSetNext("*/osSpecific", "addOSSpecific");
digester.addObjectCreate("*/configuration-dependencies",
ConfigurationDependencies.class);
digester.addBeanPropertySetter("*/config-type", "configType");
digester.addSetNext("*/configuration-dependencies", "setConfigDependencies");
digester.addSetNext("*/service", "addService");
try {
return (Metainfo) digester.parse(metainfoStream);
} catch (IOException e) {
} catch (SAXException e) {
} finally {