use of com.ibm.j9tools.om.InvalidFeatureDefinitionException in project openj9 by eclipse.
the class FeatureParser method parse.
/**
* Parse passed input stream. Expects well formed XML adhering to the specified
* schema. This method should not be called directly but rather via the FeatureIO.load
* method.
*
* @param input InputStream containing build spec XML to be parsed
* @return initialized instance of a Feature
*
* @throws InvalidFeatureDefinitionException
*/
public FeatureDefinition parse(InputStream input, String objectId, FlagDefinitions flagDefinitions) throws InvalidFeatureDefinitionException, IOException {
this.flagDefinitions = flagDefinitions;
this._feature = new FeatureDefinition();
try {
_parser.getXMLReader().parse(new InputSource(input));
} catch (SAXException e) {
// $NON-NLS-1$ //$NON-NLS-2$
error(new SAXParseException(e.getMessage(), "", "", 0, 0));
} finally {
if (hasErrors() || hasWarnings()) {
throw new InvalidFeatureDefinitionException(getErrors(), getWarnings(), objectId);
}
}
return _feature;
}
Aggregations