1 29 30 package com.caucho.xml.stream.events; 31 32 import javax.xml.namespace.QName ; 33 import javax.xml.stream.XMLStreamException; 34 import javax.xml.stream.events.EndElement; 35 import java.io.IOException ; 36 import java.io.Writer ; 37 import java.util.Iterator ; 38 39 public class EndElementImpl extends XMLEventImpl implements EndElement { 40 private final QName _name; 41 42 public EndElementImpl(QName name) 43 { 44 _name = name; 45 } 46 47 public QName getName() 48 { 49 return _name; 50 } 51 52 public Iterator getNamespaces() 53 { 54 throw new UnsupportedOperationException (); 56 } 57 58 public int getEventType() 59 { 60 return END_ELEMENT; 61 } 62 63 public void writeAsEncodedUnicode(Writer writer) 64 throws XMLStreamException 65 { 66 try { 67 writer.write("</" + _name + ">"); 68 } 69 catch (IOException e) { 70 throw new XMLStreamException(e); 71 } 72 } 73 } 74 75 | Popular Tags |