public void setDocumentLocator(Locator locator){ h.setDocumentLocator(locator); }
/** * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator) */ public void setDocumentLocator(Locator arg0) { m_saxHandler.setDocumentLocator(arg0); }
public void setDocumentLocator(Locator locator) { if(--eventcounter<=0) { // This can cause a hang. -sb // co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.setDocumentLocator(locator); } public void skippedEntity(java.lang.String name)
/** * Filter a new document locator event. * * @param locator The document locator. */ public void setDocumentLocator (Locator locator) { this.locator = locator; if (contentHandler != null) { contentHandler.setDocumentLocator(locator); } }
/** * Implements org.xml.sax.ContentHandler.setDocumentLocator() * Receive an object for locating the origin of SAX document events. */ public void setDocumentLocator(Locator locator) { _locator = locator; if (_handler != null) { _handler.setDocumentLocator(locator); } }
/** * {@inheritDoc} */ public void setDocumentLocator(Locator locator) { this.handler.setDocumentLocator(locator); }
/** * @see org.xml.sax.ContentHandler#setDocumentLocator(Locator) */ public void setDocumentLocator(Locator arg0) { m_saxHandler.setDocumentLocator(arg0); }
/** * Adapter implementation method; do not call. * Adapt a SAX1 document locator event. * * @param locator A document locator. * @see org.xml.sax.ContentHandler#setDocumentLocator */ public void setDocumentLocator (Locator locator) { this.locator = locator; if (contentHandler != null) { contentHandler.setDocumentLocator(locator); } }
public void setDocumentLocator(Locator locator) { if(--eventcounter<=0) { // This can cause a hang. -sb // co_yield(true); eventcounter=frequency; } if(clientContentHandler!=null) clientContentHandler.setDocumentLocator(locator); } public void skippedEntity(java.lang.String name)
public void setDocumentLocator(Locator locator) { ch.setDocumentLocator(locator); }
private void startDocument() throws SAXException { ContentHandler contentHandler = xmlReader.contentHandler; if (contentHandler != null) { contentHandler.setDocumentLocator(this.locator); contentHandler.startDocument(); } }
public SAXOutput(ContentHandler out) { this.out = out; out.setDocumentLocator(new LocatorImpl()); }
/** * Constructor. * @param contentHandler The implemention of the * contentHandler operation (toXMLString, digest, ...) */ public TreeWalker(ContentHandler contentHandler, DOMHelper dh) { this.m_contentHandler = contentHandler; m_contentHandler.setDocumentLocator(m_locator); try { // Bug see Bugzilla 26741 m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl"); } catch (SecurityException se){// user.dir not accessible from applet } m_dh = dh; }
/** * Constructor. * @param contentHandler The implemention of the * contentHandler operation (toXMLString, digest, ...) */ public TreeWalker(ContentHandler contentHandler) { this.m_contentHandler = contentHandler; if (m_contentHandler != null) m_contentHandler.setDocumentLocator(m_locator); try { // Bug see Bugzilla 26741 m_locator.setSystemId(System.getProperty("user.dir") + File.separator + "dummy.xsl"); } catch (SecurityException se){// user.dir not accessible from applet } m_dh = new DOM2Helper(); }
@Test public void partial() throws Exception { XMLInputFactory inputFactory = XMLInputFactory.newInstance(); XMLStreamReader streamReader = inputFactory.createXMLStreamReader(new StringReader(CONTENT)); streamReader.nextTag(); // skip to root assertEquals("Invalid element", new QName("http://springframework.org/spring-ws", "root"), streamReader.getName()); streamReader.nextTag(); // skip to child assertEquals("Invalid element", new QName("http://springframework.org/spring-ws", "child"), streamReader.getName()); StaxStreamXMLReader xmlReader = new StaxStreamXMLReader(streamReader); ContentHandler contentHandler = mock(ContentHandler.class); xmlReader.setContentHandler(contentHandler); xmlReader.parse(new InputSource()); verify(contentHandler).setDocumentLocator(any(Locator.class)); verify(contentHandler).startDocument(); verify(contentHandler).startElement(eq("http://springframework.org/spring-ws"), eq("child"), eq("child"), any(Attributes.class)); verify(contentHandler).endElement("http://springframework.org/spring-ws", "child", "child"); verify(contentHandler).endDocument(); }
/** * Parses a subtree starting from the element e and * reports SAX2 events to the specified handler. * * @deprecated in JAXB 2.0 * Use {@link #scan(Element)} */ public void parse( Element e, ContentHandler handler ) throws SAXException { // it might be better to set receiver at the constructor. receiver = handler; setCurrentLocation( e ); receiver.startDocument(); receiver.setDocumentLocator(locator); visit(e); setCurrentLocation( e ); receiver.endDocument(); }
public void scan( Element e) throws SAXException { setCurrentLocation( e ); receiver.setDocumentLocator(locator); receiver.startDocument(); NamespaceSupport nss = new NamespaceSupport(); buildNamespaceSupport( nss, e.getParentNode() ); for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String)en.nextElement(); receiver.startPrefixMapping( prefix, nss.getURI(prefix) ); } visit(e); for( Enumeration en = nss.getPrefixes(); en.hasMoreElements(); ) { String prefix = (String)en.nextElement(); receiver.endPrefixMapping( prefix ); } setCurrentLocation( e ); receiver.endDocument(); }
getContentHandler().setDocumentLocator(new Locator2() { @Override public int getColumnNumber() {
@Test public void marshalSAXResult() throws Exception { ContentHandler contentHandler = mock(ContentHandler.class); SAXResult result = new SAXResult(contentHandler); marshaller.marshal(flights, result); InOrder ordered = inOrder(contentHandler); ordered.verify(contentHandler).setDocumentLocator(isA(Locator.class)); ordered.verify(contentHandler).startDocument(); ordered.verify(contentHandler).startPrefixMapping("", "http://samples.springframework.org/flight"); ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("flights"), eq("flights"), isA(Attributes.class)); ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("flight"), eq("flight"), isA(Attributes.class)); ordered.verify(contentHandler).startElement(eq("http://samples.springframework.org/flight"), eq("number"), eq("number"), isA(Attributes.class)); ordered.verify(contentHandler).characters(isA(char[].class), eq(0), eq(2)); ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "number", "number"); ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "flight", "flight"); ordered.verify(contentHandler).endElement("http://samples.springframework.org/flight", "flights", "flights"); ordered.verify(contentHandler).endPrefixMapping(""); ordered.verify(contentHandler).endDocument(); }
getContentHandler().setDocumentLocator(new Locator2() { @Override public int getColumnNumber() {