Package com.sun.xml.txw2

Examples of com.sun.xml.txw2.TxwException


/*     */
/*     */   public void endTag() {
/*     */     try {
/*  94 */       this.out.writeEndElement();
/*     */     } catch (XMLStreamException e) {
/*  96 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here


/*     */
/*     */   public void text(StringBuilder text) {
/*     */     try {
/* 102 */       this.out.writeCharacters(text.toString());
/*     */     } catch (XMLStreamException e) {
/* 104 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */
/*     */   public void cdata(StringBuilder text) {
/*     */     try {
/* 110 */       this.out.writeCData(text.toString());
/*     */     } catch (XMLStreamException e) {
/* 112 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */
/*     */   public void comment(StringBuilder comment) {
/*     */     try {
/* 118 */       this.out.writeComment(comment.toString());
/*     */     } catch (XMLStreamException e) {
/* 120 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

/*     */   public void endDocument() {
/*     */     try {
/* 126 */       this.out.writeEndDocument();
/* 127 */       this.out.flush();
/*     */     } catch (XMLStreamException e) {
/* 129 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

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

/*  64 */         DocumentBuilder db = dbf.newDocumentBuilder();
/*  65 */         Document doc = db.newDocument();
/*  66 */         domResult.setNode(doc);
/*  67 */         this.serializer = new SaxSerializer(new Dom2SaxAdapter(doc), null, false);
/*     */       } catch (ParserConfigurationException pce) {
/*  69 */         throw new TxwException(pce);
/*     */       }
/*     */     else
/*  72 */       this.serializer = new SaxSerializer(new Dom2SaxAdapter(node), null, false);
/*     */   }
View Full Code Here

/*     */       {
/*  72 */         FileOutputStream fos = new FileOutputStream(fileURL);
/*  73 */         autoClose[0] = fos;
/*  74 */         this.writer = createWriter(fos);
/*     */       } catch (IOException e) {
/*  76 */         throw new TxwException(e);
/*     */       }
/*     */     } else {
/*  79 */       throw new IllegalArgumentException();
/*     */     }
/*     */
/*  82 */     this.serializer = new SaxSerializer(this.writer, this.writer, false, autoClose) {
/*     */       public void endDocument() {
/*  84 */         super.endDocument();
/*  85 */         if (this.val$autoClose[0] != null) {
/*     */           try {
/*  87 */             this.val$autoClose[0].close();
/*     */           } catch (IOException e) {
/*  89 */             throw new TxwException(e);
/*     */           }
/*  91 */           this.val$autoClose[0] = null;
/*     */         }
/*     */       } } ;
/*     */   }
View Full Code Here

/*     */   public void flush() {
/* 158 */     this.serializer.flush();
/*     */     try {
/* 160 */       this.writer.flush();
/*     */     } catch (IOException e) {
/* 162 */       throw new TxwException(e);
/*     */     }
/*     */   }
View Full Code Here

            try {
                FileOutputStream fos = new FileOutputStream(fileURL);
                autoClose[0] = fos;
                writer = createWriter(fos);
            } catch (IOException e) {
                throw new TxwException(e);
            }
        } else
            throw new IllegalArgumentException();

        // now delegate to the SaxSerializer
        serializer = new SaxSerializer(writer,writer,false) {
            public void endDocument() {
                super.endDocument();
                if(autoClose[0]!=null) {
                    try {
                        autoClose[0].close();
                    } catch (IOException e) {
                        throw new TxwException(e);
                    }
                    autoClose[0] = null;
                }
            }
        };
View Full Code Here

TOP

Related Classes of com.sun.xml.txw2.TxwException

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.