1 package com.sun.tools.xjc.runtime; 2 3 import javax.xml.parsers.ParserConfigurationException ; 4 5 import org.w3c.dom.Element ; 6 import org.xml.sax.Attributes ; 7 import org.xml.sax.SAXException ; 8 9 import com.sun.xml.bind.marshaller.SAX2DOMEx; 10 11 19 public class W3CDOMUnmarshallingEventHandler extends UnmarshallingEventHandlerAdaptor { 20 private Element owner; 21 22 public W3CDOMUnmarshallingEventHandler(UnmarshallingContext _ctxt) throws ParserConfigurationException , SAXException { 23 super(_ctxt, new SAX2DOMEx()); 24 } 25 26 public void enterElement(String uri, String local, String qname, Attributes atts) throws SAXException { 27 super.enterElement(uri, local, qname, atts); 28 if( owner==null ) 29 owner = ((SAX2DOMEx)handler).getCurrentElement(); 30 } 31 32 public Object owner() { 33 return owner; 34 } 35 public Element getOwner() { 36 return owner; 37 } 38 } 39 | Popular Tags |