Package com.sun.xml.txw2.output

Examples of com.sun.xml.txw2.output.XmlSerializer


    public void flush() {
        try {
            out.flush();
        } catch (XMLStreamException e) {
            throw new TxwException(e);
        }
    }
View Full Code Here


                DocumentBuilder db = dbf.newDocumentBuilder();
                Document doc = db.newDocument();
                domResult.setNode(doc);
                serializer = new SaxSerializer(new Dom2SaxAdapter(doc),null,false);
            } catch (ParserConfigurationException pce) {
                throw new TxwException(pce);
            }
        } else {
            serializer = new SaxSerializer(new Dom2SaxAdapter(node),null,false);
        }
    }
View Full Code Here

        Element element = _document.createElementNS(namespace, qName);

        if( element==null ) {
            // if so, report an user-friendly error message,
            // rather than dying mysteriously with NPE.
            throw new TxwException("Your DOM provider doesn't support the createElementNS method properly");
        }

        // process namespace bindings
        for( int i=0; i<unprocessedNamespaces.size(); i+=2 ) {
            String prefix = (String)unprocessedNamespaces.get(i+0);
View Full Code Here

/*     */   {
/* 187 */     Element element = this._document.createElementNS(namespace, qName);
/*     */
/* 189 */     if (element == null)
/*     */     {
/* 192 */       throw new TxwException("Your DOM provider doesn't support the createElementNS method properly");
/*     */     }
/*     */
/* 196 */     for (int i = 0; i < this.unprocessedNamespaces.size(); i += 2) {
/* 197 */       String prefix = (String)this.unprocessedNamespaces.get(i + 0);
/* 198 */       String uri = (String)this.unprocessedNamespaces.get(i + 1);
View Full Code Here

/*     */   {
/*     */     try
/*     */     {
/*  77 */       this.writer.startDocument();
/*     */     } catch (SAXException e) {
/*  79 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */
/* 132 */       this.writer.startElement(uri, localName, getQName(prefix, localName), this.attrs);
/*     */
/* 137 */       this.attrs.clear();
/*     */     } catch (SAXException e) {
/* 139 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */     try {
/* 145 */       this.writer.endElement((String)this.elementBindings.pop(), (String)this.elementBindings.pop(), (String)this.elementBindings.pop());
/*     */     }
/*     */     catch (SAXException e)
/*     */     {
/* 150 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */
/*     */   public void text(StringBuilder text) {
/*     */     try {
/* 156 */       this.writer.characters(text.toString().toCharArray(), 0, text.length());
/*     */     } catch (SAXException e) {
/* 158 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */     {
/* 167 */       this.lexical.startCDATA();
/* 168 */       text(text);
/* 169 */       this.lexical.endCDATA();
/*     */     } catch (SAXException e) {
/* 171 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/* 177 */       if (this.lexical == null) {
/* 178 */         throw new UnsupportedOperationException("LexicalHandler is needed to write comments");
/*     */       }
/* 180 */       this.lexical.comment(comment.toString().toCharArray(), 0, comment.length());
/*     */     } catch (SAXException e) {
/* 182 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

TOP

Related Classes of com.sun.xml.txw2.output.XmlSerializer

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.