package com.jasmine.javax.xmleventreader;

import java.io.InputStream;
import java.util.LinkedList;
import java.util.Queue;

import javax.xml.stream.XMLEventReader;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.events.XMLEvent;

import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;

public class InputStreamToXMLEvents implements ApplicationContextAware{

	

	private ApplicationContext context;
	
	public Queue<XMLEvent> getAllXMLEvents(InputStream is) throws XMLStreamException{
		XMLEventReader xmlEventReader=
		context.getBean(XMLEventReader.class, is);
		
		
		Queue<XMLEvent> eventQueue=new LinkedList<XMLEvent>();
		while (xmlEventReader.hasNext()) {
			eventQueue.add(xmlEventReader.nextEvent());
		}
		return eventQueue;
	}

	
	
	public void setApplicationContext(ApplicationContext context)
			throws BeansException {
		this.context=context;
	}

	
	
}

@@ -642,16 +642,33 @@
 ader=%0A%09%09
+(XMLEventReader) 
 context.
@@ -675,19 +675,20 @@
 getBean(
-XML
+%22xml
 EventRea
@@ -694,14 +694,9 @@
 ader
-.class
+%22
 , is

Update InputStreamToXMLEvents.java