1 55 package org.jboss.axis.encoding.ser; 56 57 import org.jboss.axis.MessageContext; 58 import org.jboss.axis.encoding.DeserializationContext; 59 import org.jboss.axis.encoding.DeserializerImpl; 60 import org.jboss.axis.message.SOAPElementAxisImpl; 61 import org.jboss.axis.utils.Messages; 62 import org.jboss.logging.Logger; 63 import org.xml.sax.SAXException ; 64 65 import java.util.List ; 66 67 72 public class DocumentDeserializer extends DeserializerImpl 73 { 74 private static Logger log = Logger.getLogger(DocumentDeserializer.class.getName()); 75 76 public static final String DESERIALIZE_CURRENT_ELEMENT = "DeserializeCurrentElement"; 77 78 public final void onEndElement(String namespace, String localName, 79 DeserializationContext context) 80 throws SAXException 81 { 82 try 83 { 84 SOAPElementAxisImpl msgElem = context.getCurElement(); 85 if (msgElem != null) 86 { 87 MessageContext messageContext = context.getMessageContext(); 88 Boolean currentElement = (Boolean )messageContext.getProperty(DESERIALIZE_CURRENT_ELEMENT); 89 if (currentElement != null && currentElement.booleanValue()) 90 { 91 value = msgElem.getAsDocument(); 92 messageContext.setProperty(DESERIALIZE_CURRENT_ELEMENT, Boolean.FALSE); 93 return; 94 } 95 List children = msgElem.getChildren(); 96 if (children != null) 97 { 98 msgElem = (SOAPElementAxisImpl)children.get(0); 99 if (msgElem != null) 100 value = msgElem.getAsDocument(); 101 } 102 } 103 } 104 catch (Exception exp) 105 { 106 log.error(Messages.getMessage("exception00"), exp); 107 throw new SAXException (exp); 108 } 109 } 110 } 111 | Popular Tags |