Package com.sun.xml.bind.v2.runtime.output

Examples of com.sun.xml.bind.v2.runtime.output.SAXOutput


        } 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?
    }
View Full Code Here


    /**
     * Creates {@link XmlOutput} from the given {@link Result} object.
     */
    final XmlOutput createXmlOutput(Result result) throws JAXBException {
        if (result instanceof SAXResult)
            return new SAXOutput(((SAXResult) result).getHandler());

        if (result instanceof DOMResult) {
            final Node node = ((DOMResult) result).getNode();

            if (node == null) {
                Document doc = JAXBContextImpl.createDom();
                ((DOMResult) result).setNode(doc);
                return new SAXOutput(new SAX2DOMEx(doc));
            } else {
                return new SAXOutput(new SAX2DOMEx(node));
            }
        }
        if (result instanceof StreamResult) {
            StreamResult sr = (StreamResult) result;

View Full Code Here

                    public void startPrefixMapping(String prefix, String uri) throws SAXException {
                        super.startPrefixMapping(prefix.intern(), uri.intern());
                    }
                };
                f.setContentHandler(validator);
                out = new ForkXmlOutput( new SAXOutput(f) {
                    @Override
                    public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException {
                        super.startDocument(serializer, false, nsUriIndex2prefixIndex, nsContext);
                    }
                    @Override
View Full Code Here

        } 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?
    }
View Full Code Here

        m.write(tagName,bi,t,m.createWriter(output),pia);
    }

    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));
    }
View Full Code Here

        m.write(tagName,bi,t,new SAXOutput(new SAX2DOMEx(output)),new DomPostInitAction(output,m.serializer));
    }

    public void marshal(Marshaller _m, T t, ContentHandler contentHandler) throws JAXBException {
        MarshallerImpl m = (MarshallerImpl)_m;
        m.write(tagName,bi,t,new SAXOutput(contentHandler),null);
    }
View Full Code Here

/*     */
/*     */   final XmlOutput createXmlOutput(Result result)
/*     */     throws JAXBException
/*     */   {
/* 179 */     if ((result instanceof SAXResult)) {
/* 180 */       return new SAXOutput(((SAXResult)result).getHandler());
/*     */     }
/* 182 */     if ((result instanceof DOMResult)) {
/* 183 */       Node node = ((DOMResult)result).getNode();
/*     */
/* 185 */       if (node == null) {
/* 186 */         Document doc = JAXBContextImpl.createDom();
/* 187 */         ((DOMResult)result).setNode(doc);
/* 188 */         return new SAXOutput(new SAX2DOMEx(doc));
/*     */       }
/* 190 */       return new SAXOutput(new SAX2DOMEx(node));
/*     */     }
/*     */
/* 193 */     if ((result instanceof StreamResult)) {
/* 194 */       StreamResult sr = (StreamResult)result;
/*     */
View Full Code Here

/*     */           public void startPrefixMapping(String prefix, String uri) throws SAXException {
/* 299 */             super.startPrefixMapping(prefix.intern(), uri.intern());
/*     */           }
/*     */         };
/* 302 */         f.setContentHandler(validator);
/* 303 */         out = new ForkXmlOutput(new SAXOutput(f)
/*     */         {
/*     */           public void startDocument(XMLSerializer serializer, boolean fragment, int[] nsUriIndex2prefixIndex, NamespaceContextImpl nsContext) throws SAXException, IOException, XMLStreamException {
/* 306 */             super.startDocument(serializer, false, nsUriIndex2prefixIndex, nsContext);
/*     */           }
/*     */
View Full Code Here

/*     */     } else {
/* 418 */       xw = new XMLWriter(w, encoding, ceh);
/*     */     }
/* 420 */     xw.setXmlDecl(!isFragment());
/* 421 */     xw.setHeader(this.header);
/* 422 */     return new SAXOutput(xw);
/*     */   }
View Full Code Here

/* 100 */     m.write(this.tagName, this.bi, t, m.createWriter(output), pia);
/*     */   }
/*     */
/*     */   public void marshal(Marshaller _m, T t, Node output) throws JAXBException {
/* 104 */     MarshallerImpl m = (MarshallerImpl)_m;
/* 105 */     m.write(this.tagName, this.bi, t, new SAXOutput(new SAX2DOMEx(output)), new DomPostInitAction(output, m.serializer));
/*     */   }
View Full Code Here

TOP

Related Classes of com.sun.xml.bind.v2.runtime.output.SAXOutput

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.