1 16 17 package org.apache.axis.encoding; 18 19 import java.io.IOException ; 20 import java.io.Writer ; 21 22 import javax.xml.namespace.QName ; 23 24 import org.apache.axis.MessageContext; 25 import org.apache.axis.utils.Messages; 26 27 import org.w3c.dom.Element ; 28 29 import org.xml.sax.Attributes ; 30 31 36 public class TextSerializationContext extends SerializationContext { 37 38 private boolean ignore = false; 39 private int depth = 0; 40 41 public TextSerializationContext(Writer writer) 42 { 43 super(writer); 44 startOfDocument = false; } 46 47 public TextSerializationContext(Writer writer, MessageContext msgContext) 48 { 49 super(writer, msgContext); 50 startOfDocument = false; } 52 53 public void serialize(QName elemQName, 54 Attributes attributes, 55 Object value, 56 QName xmlType, 57 Boolean sendNull, 58 Boolean sendType) 59 throws IOException 60 { 61 throw new IOException (Messages.getMessage("notImplemented00", 62 "serialize")); 63 } 64 65 public void writeDOMElement(Element el) 66 throws IOException 67 { 68 throw new IOException (Messages.getMessage("notImplemented00", 69 "writeDOMElement")); 70 } 71 72 public void startElement(QName qName, Attributes attributes) 73 throws IOException 74 { 75 depth++; 76 if (depth == 2) { 77 this.ignore = true; 78 } 79 } 80 81 public void endElement() 82 throws IOException 83 { 84 depth--; 85 ignore = true; 86 } 87 88 public void writeChars(char [] p1, int p2, int p3) 89 throws IOException 90 { 91 if (!this.ignore) { 92 super.writeChars(p1, p2, p3); 93 } 94 } 95 96 public void writeString(String string) 97 throws IOException 98 { 99 if (!this.ignore) { 100 super.writeString(string); 101 } 102 } 103 104 } 105 | Popular Tags |