1 16 17 package org.apache.ws.jaxme.pm.ino.api4j; 18 19 import java.lang.reflect.UndeclaredThrowableException ; 20 21 import javax.xml.bind.JAXBException; 22 23 import org.apache.ws.jaxme.impl.JMUnmarshallerHandlerImpl; 24 import org.apache.ws.jaxme.pm.ino.InoObject; 25 import org.xml.sax.Attributes ; 26 import org.xml.sax.Locator ; 27 import org.xml.sax.SAXException ; 28 29 import com.softwareag.tamino.db.api.objectModel.sax.TSAXDocument; 30 import com.softwareag.tamino.db.api.objectModel.sax.TSAXDocumentDefaultHandler; 31 32 33 36 public class DocumentDefaultHandler extends TSAXDocumentDefaultHandler { 37 private static final ThreadLocal handler = new ThreadLocal (); 38 39 static JMUnmarshallerHandlerImpl getUnmarshallerHandler() { 40 return (JMUnmarshallerHandlerImpl) handler.get(); 41 } 42 43 static void setUnmarshallerHandler(JMUnmarshallerHandlerImpl pHandler) { 44 handler.set(pHandler); 45 } 46 47 public DocumentDefaultHandler() { 48 } 49 50 public void startDocument() throws SAXException { 51 getUnmarshallerHandler().startDocument(); 52 } 53 54 public void endDocument() throws SAXException { 55 getUnmarshallerHandler().endDocument(); 56 } 57 58 public void startElement(String pNamespaceURI, String pLocalName, String pQName, 59 Attributes pAttr) throws SAXException { 60 getUnmarshallerHandler().startElement(pNamespaceURI, pLocalName, pQName, pAttr); 61 } 62 63 public void endElement(String pNamespaceURI, String pLocalName, String pQName) 64 throws SAXException { 65 getUnmarshallerHandler().endElement(pNamespaceURI, pLocalName, pQName); 66 } 67 68 public void characters(char[] pBuffer, int pOffset, int pLen) throws SAXException { 69 getUnmarshallerHandler().characters(pBuffer, pOffset, pLen); 70 } 71 72 public void ignorableWhitespace(char[] pBuffer, int pOffset, int pLen) throws SAXException { 73 getUnmarshallerHandler().ignorableWhitespace(pBuffer, pOffset, pLen); 74 } 75 76 public void processingInstruction(String pTarget, String pData) throws SAXException { 77 getUnmarshallerHandler().processingInstruction(pTarget, pData); 78 } 79 80 public void skippedEntity(String pEntity) throws SAXException { 81 getUnmarshallerHandler().skippedEntity(pEntity); 82 } 83 84 public void endPrefixMapping(String pPrefix) throws SAXException { 85 getUnmarshallerHandler().endPrefixMapping(pPrefix); 86 } 87 88 public void startPrefixMapping(String pPrefix, String pNamespaceURI) throws SAXException { 89 getUnmarshallerHandler().startPrefixMapping(pPrefix, pNamespaceURI); 90 } 91 92 public void setDocumentLocator(Locator pLocator) { 93 getUnmarshallerHandler().setDocumentLocator(pLocator); 94 } 95 96 public TSAXDocument getDocument() { 97 try { 98 return new TJMElement((InoObject) getUnmarshallerHandler().getResult()); 99 } catch (JAXBException e) { 100 throw new UndeclaredThrowableException (e); 101 } 102 } 103 } 104 | Popular Tags |