@Test public void testResetPageReader() throws Exception { URL testContext = this.getClass().getResource(testFile); String testXml = TestUtils.loadXmlFromResource(testFile); URL otherTestContext = this.getClass().getResource(otherTestFile); String otherTestXml = TestUtils.loadXmlFromResource(otherTestFile); assertEquals(testXml, new String(page.toXml().getBytes("utf-8"), "utf-8")); page = reader.read(otherTestContext.openStream(), site); assertEquals(otherTestXml, new String(page.toXml().getBytes("utf-8"), "utf-8")); page = reader.read(testContext.openStream(), site); assertEquals(testXml, new String(page.toXml().getBytes("utf-8"), "utf-8")); }
public PageImpl read(InputStream is, Site site) throws SAXException, IOException, ParserConfigurationException { reset(); page = new PageImpl(new PageURIImpl(site, "/")); readHeader = true; readBody = true; SAXParser parser = parserRef.get(); if (parser == null) { parser = parserFactory.newSAXParser(); parserRef = new WeakReference<SAXParser>(parser); } parser.parse(is, this); return page; }
PageReader extends WebloungeContentReader implements ResourceReader<ResourceContent, Page> { public PageImpl read(InputStream is, Site site) throws SAXException, IOException, ParserConfigurationException { reset(); page = new PageImpl(new PageURIImpl(site, "/")); readHeader = true; readBody = true; SAXParser parser = parserRef.get(); if (parser == null) { parser = parserFactory.newSAXParser(); parserRef = new WeakReference<SAXParser>(parser); } parser.parse(is, this); return page; } }
PageReader extends WebloungeContentReader implements ResourceReader<ResourceContent, Page> { public PageImpl read(InputStream is, Site site) throws SAXException, IOException, ParserConfigurationException { reset(); page = new PageImpl(new PageURIImpl(site, "/")); readHeader = true; readBody = true; SAXParser parser = parserRef.get(); if (parser == null) { parser = parserFactory.newSAXParser(); parserRef = new WeakReference<SAXParser>(parser); } parser.parse(is, this); return page; } PageReader(); }
PageReader extends WebloungeContentReader implements ResourceReader<ResourceContent, Page> { public PageImpl read(InputStream is, Site site) throws SAXException, IOException, ParserConfigurationException { reset(); page = new PageImpl(new PageURIImpl(site, "/")); readHeader = true; readBody = true; SAXParser parser = parserRef.get(); if (parser == null) { parser = parserFactory.newSAXParser(); parserRef = new WeakReference<SAXParser>(parser); } parser.parse(is, this); return page; } PageReader(); PageImpl read(InputStream is, Site site); PageImpl readHeader(InputStream is, Site site); PageImpl readBody(InputStream is, Site site); void init(PageImpl page); void reset(); void startElement(String uri, String local, String raw,
      Attributes attrs); void endElement(String uri, String local, String raw); void characters(char[] chars, int start, int end); void warning(SAXParseException e); void error(SAXParseException e); void fatalError(SAXParseException e); }
PageReader extends WebloungeContentReader implements ResourceReader<ResourceContent, Page> { public PageImpl read(InputStream is, Site site) throws SAXException, IOException, ParserConfigurationException { reset(); page = new PageImpl(new PageURIImpl(site, "/")); readHeader = true; readBody = true; SAXParser parser = parserRef.get(); if (parser == null) { parser = parserFactory.newSAXParser(); parserRef = new WeakReference<SAXParser>(parser); } parser.parse(is, this); return page; } PageReader(); PageImpl read(InputStream is, Site site); PageImpl readHeader(InputStream is, Site site); PageImpl readBody(InputStream is, Site site); void init(PageImpl page); void reset(); void startElement(String uri, String local, String raw,
      Attributes attrs); void endElement(String uri, String local, String raw); void characters(char[] chars, int start, int end); void warning(SAXParseException e); void error(SAXParseException e); void fatalError(SAXParseException e);  }