1 31 package org.objectweb.proactive.core.xml.handler; 32 33 import org.objectweb.proactive.core.xml.io.Attributes; 34 35 43 public class BasicUnmarshallerDecorator extends AbstractUnmarshallerDecorator { 44 45 protected Object resultObject; 46 protected boolean isResultValid = true; 47 48 52 public BasicUnmarshallerDecorator(boolean lenient) { 53 super(lenient); 54 } 55 56 public BasicUnmarshallerDecorator() { 57 super(); 58 } 59 60 61 65 69 public Object getResultObject() throws org.xml.sax.SAXException { 70 if (! isResultValid) throw new org.xml.sax.SAXException ("The result object is not valid"); 71 Object o = resultObject; 72 resultObject = null; 73 isResultValid = false; 74 return o; 75 } 76 77 78 public void startContextElement(String name, Attributes attributes) throws org.xml.sax.SAXException { 79 } 80 81 82 83 87 protected void notifyEndActiveHandler(String name, UnmarshallerHandler activeHandler) throws org.xml.sax.SAXException { 88 setResultObject(activeHandler.getResultObject()); 89 } 90 91 protected void setResultObject(Object value) { 92 isResultValid = true; 93 resultObject = value; 94 } 95 96 100 101 105 } | Popular Tags |