Code example for DocumentBuilder

Methods: parse

0
    public static AndroidManifestWriter parse(String osManifestFilePath) {
        try { 
            DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
            docFactory.setNamespaceAware(true);
            DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
            Document doc = docBuilder.parse(osManifestFilePath);
            return new AndroidManifestWriter(doc, osManifestFilePath);
        } catch (ParserConfigurationException e) {
            sLogger.log(Level.SEVERE, "Error parsing file", e);
            return null; 
        } catch (SAXException e) {
            sLogger.log(Level.SEVERE, "Error parsing file", e);
            return null; 
        } catch (IOException e) {
            sLogger.log(Level.SEVERE, "Error parsing file", e);
            return null; 
        } 
    } 
}