Code example for SAXSource

Methods: getInputSource, getXMLReader

0
    } 
     
    public Object unmarshal(Source pSource) throws JAXBException {
        if (pSource instanceof SAXSource) {
            SAXSource ss = (SAXSource) pSource;
            InputSource is = ss.getInputSource();
            if (is == null) {
                throw new UnmarshalException("The SAXResult doesn't have its InputSource set."); 
            } 
            XMLReader xr = ss.getXMLReader();
            if (xr == null) {
                return unmarshal(is);
            } else { 
                UnmarshallerHandler uh = getUnmarshallerHandler();
                xr.setContentHandler(uh);
                try { 
                    xr.parse(is);
                } catch (IOException e) {
                    throw new JAXBException(e);
                } catch (SAXException e) {
                    if (e.getException() != null) {