public void marshal(Marshaller _m, T t, ContentHandler contentHandler) throws JAXBException { MarshallerImpl m = (MarshallerImpl)_m; m.write(tagName,bi,t,new SAXOutput(contentHandler),null); }
@Override public void endDocument(boolean fragment) throws SAXException, IOException, XMLStreamException { super.endDocument(false); } }, out );
public void beginStartTag(int prefix, String localName) { elementNsUri = nsContext.getNamespaceURI(prefix); elementLocalName = localName; elementQName = getQName(prefix,localName); atts.clear(); }
@Override public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException { super.startDocument(serializer, false, nsUriIndex2prefixIndex, nsContext); } @Override
@Override public void endStartTag() throws SAXException { super.endStartTag(); Object op = nsContext.getCurrent().getOuterPeer(); if(op!=null) assoc.addOuter( getBuilder().getCurrentElement(), op ); Object ip = nsContext.getCurrent().getInnerPeer(); if(ip!=null) assoc.addInner( getBuilder().getCurrentElement(), ip ); } }
@Override public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException { super.startDocument(serializer, false, nsUriIndex2prefixIndex, nsContext); } @Override
@Override public void endStartTag() throws SAXException { super.endStartTag(); Object op = nsContext.getCurrent().getOuterPeer(); if(op!=null) assoc.addOuter( getBuilder().getCurrentElement(), op ); Object ip = nsContext.getCurrent().getInnerPeer(); if(ip!=null) assoc.addInner( getBuilder().getCurrentElement(), ip ); } }
public void marshal(Marshaller _m, T t, Node output) throws JAXBException { MarshallerImpl m = (MarshallerImpl)_m; m.write(tagName,bi,t,new SAXOutput(new SAX2DOMEx(output)),new DomPostInitAction(output,m.serializer)); }
public void endTag(int prefix, String localName) throws SAXException { out.endElement( nsContext.getNamespaceURI(prefix), localName, getQName(prefix, localName) ); NamespaceContextImpl.Element ns = nsContext.getCurrent(); if(ns!=null) { int sz = ns.count(); for( int i=sz-1; i>=0; i-- ) { String p = ns.getPrefix(i); String uri = ns.getNsUri(i); if(uri.length()==0 && ns.getBase()==1) continue; // no point in definint xmlns='' on the root out.endPrefixMapping(p); } } }
@Override public void endDocument(boolean fragment) throws SAXException, IOException, XMLStreamException { super.endDocument(false); } }, out );
@Override public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException { super.startDocument(serializer, false, nsUriIndex2prefixIndex, nsContext); } @Override
@Override public void endStartTag() throws SAXException { super.endStartTag(); Object op = nsContext.getCurrent().getOuterPeer(); if(op!=null) assoc.addOuter( getBuilder().getCurrentElement(), op ); Object ip = nsContext.getCurrent().getInnerPeer(); if(ip!=null) assoc.addInner( getBuilder().getCurrentElement(), ip ); } }
public void beginStartTag(int prefix, String localName) { elementNsUri = nsContext.getNamespaceURI(prefix); elementLocalName = localName; elementQName = getQName(prefix,localName); atts.clear(); }
@Override public void endDocument(boolean fragment) throws SAXException, IOException, XMLStreamException { super.endDocument(false); } }, out );
@Override public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException { super.startDocument(serializer, false, nsUriIndex2prefixIndex, nsContext); } @Override
@Override public void endStartTag() throws SAXException { super.endStartTag(); Object op = nsContext.getCurrent().getOuterPeer(); if(op!=null) assoc.addOuter( getBuilder().getCurrentElement(), op ); Object ip = nsContext.getCurrent().getInnerPeer(); if(ip!=null) assoc.addInner( getBuilder().getCurrentElement(), ip ); } }
public XmlOutput createWriter( Writer w, String encoding ) { // XMLWriter doesn't do buffering, so do it here if it looks like a good idea if(!(w instanceof BufferedWriter)) w = new BufferedWriter(w); assert toBeFlushed==null; toBeFlushed = w; CharacterEscapeHandler ceh = createEscapeHandler(encoding); XMLWriter xw; if(isFormattedOutput()) { DataWriter d = new DataWriter(w,encoding,ceh); d.setIndentStep(indent); xw=d; } else xw = new XMLWriter(w,encoding,ceh); xw.setXmlDecl(!isFragment()); xw.setHeader(header); return new SAXOutput(xw); // TODO: don't we need a better writer? }
public void endTag(int prefix, String localName) throws SAXException { out.endElement( nsContext.getNamespaceURI(prefix), localName, getQName(prefix, localName) ); NamespaceContextImpl.Element ns = nsContext.getCurrent(); if(ns!=null) { int sz = ns.count(); for( int i=sz-1; i>=0; i-- ) { String p = ns.getPrefix(i); String uri = ns.getNsUri(i); if(uri.length()==0 && ns.getBase()==1) continue; // no point in definint xmlns='' on the root out.endPrefixMapping(p); } } }
@Override public void endDocument(boolean fragment) throws SAXException, IOException, XMLStreamException { super.endDocument(false); } }, out );