public Object parse()

in src/main/java/com/aliyun/mns/common/parser/JAXBResultParser.java [86:111]


    public Object parse(InputStream is) throws ResultParseException {
        assert (is != null);

        try {
            if (!cachedContexts.containsKey(modelClass)) {
                initJAXBContext(modelClass);
            }

            assert (cachedContexts.containsKey(modelClass));
            JAXBContext jc = cachedContexts.get(modelClass);
            Unmarshaller um = jc.createUnmarshaller();
            // It performs better to call Unmarshaller#unmarshal(Source)
            // than to call Unmarshaller#unmarshall(InputStream)
            // if XMLReader is specified in the SAXSource instance.
            return um.unmarshal(getSAXSource(is));
        } catch (JAXBException e) {
            throw new ResultParseException(ResourceManager.getInstance(ServiceConstants.RESOURCE_NAME_COMMON)
                .getString("FailedToParseResponse"), e);
        } catch (SAXException e) {
            throw new ResultParseException(ResourceManager.getInstance(ServiceConstants.RESOURCE_NAME_COMMON)
                .getString("FailedToParseResponse"), e);
        } catch (ParserConfigurationException e) {
            throw new ResultParseException(ResourceManager.getInstance(ServiceConstants.RESOURCE_NAME_COMMON)
                .getString("FailedToParseResponse"), e);
        }
    }