public class ESalesParser extends Object
Modifier and Type | Field and Description |
---|---|
private org.apache.commons.logging.Log |
log |
static String |
SAMPLE_FILE |
protected Unmarshaller |
um |
protected XMLInputFactory |
xmlif |
protected XMLStreamReader |
xmlr |
Constructor and Description |
---|
ESalesParser(Class<?> rootType,
InputStream is)
Pass in the JAXB class that represents the root node of the document
and an InputStream for the document to parse.
|
Modifier and Type | Method and Description |
---|---|
private boolean |
contains(String[] elements,
String localName) |
Object |
getObject(String... elements)
This method will return either the object or null if we hit the end
of stream before getting another instance.
|
static InputStream |
getSampleData() |
void |
setSchema(InputStream schema) |
private org.apache.commons.logging.Log log
protected XMLInputFactory xmlif
protected Unmarshaller um
protected XMLStreamReader xmlr
public static final String SAMPLE_FILE
public ESalesParser(Class<?> rootType, InputStream is) throws JAXBException, XMLStreamException
rootType
- - the class of the root typeis
- - am input stream with document to parseJAXBException
XMLStreamException
public void setSchema(InputStream schema) throws SAXException
SAXException
public Object getObject(String... elements) throws XMLStreamException, JAXBException
element
- XMLStreamException
JAXBException
public static InputStream getSampleData()
Copyright © 2015 John's Hopkins University, Engineering Programs for Professionals. All rights reserved.