Class XmlUtils.SAXBasedXmlnsFilteringParser

    • Constructor Detail

      • SAXBasedXmlnsFilteringParser

        public SAXBasedXmlnsFilteringParser​(javax.xml.bind.Unmarshaller unmarshaller,
                                            Map<String,​String> xmlnsPrefixToUriMap)
        Creates instance from JAXB unmarshaller used for parsing XML documents using default namespace prefix-to-URI mappings
        Parameters:
        unmarshaller - JAXB unmarshaller
        xmlnsPrefixToUriMap - optional (possibly empty) XML namespace prefix-to-URI map, used for example when one needs to reuse namespace prefix/URIs previously retrieved through another XML parser interface, but needs to wrap it under the same XmlUtils.XmlnsFilteringParser interface for later purposes.
      • SAXBasedXmlnsFilteringParser

        public SAXBasedXmlnsFilteringParser​(javax.xml.bind.Unmarshaller unmarshaller)
        Creates instance from JAXB unmarshaller used for parsing XML documents
        Parameters:
        unmarshaller - JAXB unmarshaller
    • Method Detail

      • parse

        public Object parse​(InputSource input)
                     throws javax.xml.bind.JAXBException
        Description copied from interface: XmlUtils.XmlnsFilteringParser
        Unmarshal XML data from the specified SAX InputSource and return the resulting content tree.
        Specified by:
        parse in interface XmlUtils.XmlnsFilteringParser
        Parameters:
        input - the input source to unmarshal XML data from
        Returns:
        the newly created root object of the java content tree
        Throws:
        javax.xml.bind.JAXBException - If any unexpected errors occur while unmarshalling
      • parse

        public Object parse​(URL url)
                     throws javax.xml.bind.JAXBException
        Description copied from interface: XmlUtils.XmlnsFilteringParser
        Unmarshal XML data from the specified URL and return the resulting content tree.
        Specified by:
        parse in interface XmlUtils.XmlnsFilteringParser
        Parameters:
        url - the URL to unmarshal XML data from
        Returns:
        the newly created root object of the java content tree
        Throws:
        javax.xml.bind.JAXBException - If any unexpected errors occur while unmarshalling