/** * Reads itself from XML format * New added - for Sandwich project (XML format instead of serialization) . * @param is input stream (which is parsed) * @return Table */ public void readFromXML(InputStream is, boolean validate) throws SAXException { StringBuffer fileName = new StringBuffer(); ElementHandler[] elmKeyService = { parseFirstLevel(), parseSecondLevel(fileName), parseThirdLevel(fileName) }; // String dtd = getClass().getClassLoader().getResource(DTD_PATH).toExternalForm(); InnerParser parser = new InnerParser(PUBLIC_ID, dtd, elmKeyService); try { parser.parseXML(is, validate); } catch (Exception ioe) { throw (SAXException) ExternalUtil.copyAnnotation( new SAXException(NbBundle.getMessage(DefaultAttributes.class, "EXC_DefAttrReadErr")), ioe ); } catch (FactoryConfigurationError fce) { // ??? see http://openide.netbeans.org/servlets/ReadMsg?msgId=340881&listName=dev throw (SAXException) ExternalUtil.copyAnnotation( new SAXException(NbBundle.getMessage(DefaultAttributes.class, "EXC_DefAttrReadErr")), fce ); } }
/** Starts parsing document - if you have document`s InputStream * @param validate * @param is document`s InputStream * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public void parseXML(InputStream is, boolean validate) throws IOException, SAXException, ParserConfigurationException, FactoryConfigurationError { InputSource iSource = new InputSource(is); XMLReader parser = getParser(validate); parser.parse(iSource); }
/** * Reads itself from XML format * New added - for Sandwich project (XML format instead of serialization) . * @param is input stream (which is parsed) * @return Table */ public void readFromXML (InputStream is, boolean validate) throws SAXException { StringBuffer fileName = new StringBuffer(); ElementHandler[] elmKeyService = {parseFirstLevel(),parseSecondLevel(fileName),parseThirdLevel(fileName)};// String dtd = getClass().getClassLoader().getResource( DTD_PATH ).toExternalForm(); InnerParser parser = new InnerParser(PUBLIC_ID, dtd, elmKeyService); try { parser.parseXML(is, validate); } catch(Exception ioe) { throw (SAXException)ExternalUtil.copyAnnotation (new SAXException (NbBundle.getMessage(DefaultAttributes.class,"EXC_DefAttrReadErr")),ioe); } catch (FactoryConfigurationError fce) { // ??? see http://openide.netbeans.org/servlets/ReadMsg?msgId=340881&listName=dev throw (SAXException)ExternalUtil.copyAnnotation(new SAXException(NbBundle.getMessage(DefaultAttributes.class, "EXC_DefAttrReadErr")), fce); } }
/** * Reads itself from XML format * New added - for Sandwich project (XML format instead of serialization) . * @param is input stream (which is parsed) * @return Table */ public void readFromXML (InputStream is, boolean validate) throws SAXException { StringBuffer fileName = new StringBuffer(); ElementHandler[] elmKeyService = {parseFirstLevel(),parseSecondLevel(fileName),parseThirdLevel(fileName)};// String dtd = getClass().getClassLoader().getResource( DTD_PATH ).toExternalForm(); InnerParser parser = new InnerParser(PUBLIC_ID, dtd, elmKeyService); try { parser.parseXML(is, validate); } catch(Exception ioe) { throw (SAXException)ExternalUtil.copyAnnotation (new SAXException (NbBundle.getMessage(DefaultAttributes.class,"EXC_DefAttrReadErr")),ioe); } catch (FactoryConfigurationError fce) { // ??? see http://openide.netbeans.org/servlets/ReadMsg?msgId=340881&listName=dev throw (SAXException)ExternalUtil.copyAnnotation(new SAXException(NbBundle.getMessage(DefaultAttributes.class, "EXC_DefAttrReadErr")), fce); } }
/** Starts parsing document - if you have document`s InputStream * @param validate * @param is document`s InputStream * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public void parseXML(InputStream is, boolean validate) throws IOException, SAXException, ParserConfigurationException, FactoryConfigurationError { InputSource iSource = new InputSource(is); Parser parser = getParser(validate); parser.parse(iSource); }
/** Starts parsing document - if you have document`s InputStream * @param validate * @param is document`s InputStream * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public void parseXML(InputStream is, boolean validate) throws IOException, SAXException, ParserConfigurationException, FactoryConfigurationError { InputSource iSource = new InputSource(is); Parser parser = getParser(validate); parser.parse(iSource); }
/** Starts parsing document, that can be localized by means of uri parameter * @param validate * @param uri adress of document, that will be parsed * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public void parseXML(String uri, boolean validate) throws IOException, SAXException, ParserConfigurationException, FactoryConfigurationError { Parser parser = getParser(validate); parser.parse(uri); }
/** Starts parsing document, that can be localized by means of uri parameter * @param validate * @param uri adress of document, that will be parsed * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public void parseXML(String uri, boolean validate) throws IOException, SAXException, ParserConfigurationException, FactoryConfigurationError { Parser parser = getParser(validate); parser.parse(uri); }
/** Starts parsing document, that can be localized by means of uri parameter * @param validate * @param uri adress of document, that will be parsed * @throws ParserConfigurationException * @throws IOException * @throws SAXException */ public void parseXML(String uri, boolean validate) throws IOException, SAXException, ParserConfigurationException, FactoryConfigurationError { XMLReader parser = getParser(validate); parser.parse(uri); }