1 31 package org.objectweb.proactive.core.xml.handler; 32 33 import org.objectweb.proactive.core.xml.io.Attributes; 34 35 36 44 public class BasicUnmarshaller implements UnmarshallerHandler { 45 protected Object resultObject; 46 protected boolean isResultValid = true; 47 48 public BasicUnmarshaller() { 52 } 53 54 public Object getResultObject() throws org.xml.sax.SAXException { 61 if (!isResultValid) { 62 throw new org.xml.sax.SAXException ("The result object is not valid"); 63 } 64 Object o = resultObject; 65 resultObject = null; 66 isResultValid = false; 67 return o; 68 } 69 70 public void startContextElement(String name, Attributes attributes) 71 throws org.xml.sax.SAXException { 72 } 73 74 public void startElement(String name, Attributes attributes) 78 throws org.xml.sax.SAXException { 79 } 80 81 public void endElement(String name) throws org.xml.sax.SAXException { 82 } 83 84 public void readValue(String value) throws org.xml.sax.SAXException { 85 } 86 87 public void startPrefixMapping(String prefix, String uri) 88 throws org.xml.sax.SAXException { 89 } 90 91 public void endPrefixMapping(String prefix) throws org.xml.sax.SAXException { 92 } 93 94 protected void setResultObject(Object value) { 98 isResultValid = true; 99 resultObject = value; 100 } 101 102 protected boolean checkNonEmpty(String s) { 103 return (s != null) && (s.length() > 0); 104 } 105 106 } 110 | Popular Tags |