public void parse () throws Exception { if (_root == null) { try { XmlParser parser = ensureParser(); _root = parser.parse(_xml.getInputStream()); _dtd = parser.getDTD(); } finally { _xml.close(); } } }
/** * Reads and parses the XML configuration file. * * @param f an XML configuration file * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public static XmlParser.Node parse(File f) throws SAXException, IOException { // we don't expect to need this very often, // so just make a new parser every time return initParser().parse(f); }
/** * Parse String URL. */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
/** * Parse String URL. */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
/** * Parse String URL. */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
/** * Parse String URL. */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
/** * Parse String URL. */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
/** * Parse String URL. * @param url the url to the xml to parse * @return the root node of the xml * @throws IOException if unable to load the xml * @throws SAXException if unable to parse the xml */ public synchronized Node parse(String url) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + url); return parse(new InputSource(url)); }
/** * Reads and parses the XML configuration file. * * @param configuration the URL of the XML configuration * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public XmlConfiguration(URL configuration) throws SAXException, IOException { synchronized (__parser) { _url=configuration; setConfig(__parser.parse(configuration.toString())); _dtd=__parser.getDTD(); } }
/** * Reads and parses the XML configuration stream. * * @param configuration An input stream containing a complete configuration file * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public XmlConfiguration(InputStream configuration) throws SAXException, IOException { InputSource source = new InputSource(configuration); synchronized (__parser) { setConfig(__parser.parse(source)); _dtd=__parser.getDTD(); } }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Reads and parses the XML configuration file. * * @param configuration the URL of the XML configuration * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public XmlConfiguration(URL configuration) throws SAXException, IOException { synchronized (__parser) { _url=configuration; setConfig(__parser.parse(configuration.toString())); _dtd=__parser.getDTD(); } }
/** * Reads and parses the XML configuration stream. * * @param configuration An input stream containing a complete configuration file * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public XmlConfiguration(InputStream configuration) throws SAXException, IOException { InputSource source = new InputSource(configuration); synchronized (__parser) { setConfig(__parser.parse(source)); _dtd=__parser.getDTD(); } }
/** * Reads and parses the XML configuration file. * * @param configuration the URL of the XML configuration * @throws IOException if the configuration could not be read * @throws SAXException if the configuration could not be parsed */ public XmlConfiguration(URL configuration) throws SAXException, IOException { synchronized (__parser) { _url=configuration; setConfig(__parser.parse(configuration.toString())); _dtd=__parser.getDTD(); } }
/** * Parse File. */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
/** * Parse File. * @param file the file to the xml to parse * @return the root node of the xml * @throws IOException if unable to load the xml * @throws SAXException if unable to parse the xml */ public synchronized Node parse(File file) throws IOException, SAXException { if (LOG.isDebugEnabled()) LOG.debug("parse: " + file); return parse(new InputSource(Resource.toURL(file).toString())); }
public void parse () throws Exception { if (_parser == null) ensureParser(); if (_root == null) { try { _root = _parser.parse(_xml.getInputStream()); } finally { _xml.release(); } } }