Class ESalesParser


  • public class ESalesParser
    extends Object
    This class will read in Java objects from a specified XML file. These objects can be used to create ingest data for projects.
    • Constructor Detail

      • ESalesParser

        public ESalesParser​(Class<?> rootType,
                            InputStream is)
                     throws javax.xml.bind.JAXBException,
                            XMLStreamException
        Pass in the JAXB class that represents the root node of the document and an InputStream for the document to parse.
        Parameters:
        rootType - - the class of the root type
        is - - am input stream with document to parse
        Throws:
        javax.xml.bind.JAXBException
        XMLStreamException
    • Method Detail

      • contains

        private boolean contains​(String[] elements,
                                 String localName)
      • getObject

        public Object getObject​(String... elements)
                         throws XMLStreamException,
                                javax.xml.bind.JAXBException
        This method will return either the object or null if we hit the end of stream before getting another instance. Note that only the local-name is being used. That won't work to great when two namespaces declare a common local-name. Should be easily fixable when needed.
        Parameters:
        element -
        Returns:
        Throws:
        XMLStreamException
        javax.xml.bind.JAXBException
      • getSampleData

        public static InputStream getSampleData()