< prev index next >

src/java.xml/share/classes/com/sun/xml/internal/stream/events/XMLEventAllocatorImpl.java

Print this page




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.xml.internal.stream.events;
  26 
  27 import com.sun.org.apache.xerces.internal.impl.PropertyManager;
  28 import java.util.List;
  29 import javax.xml.stream.util.XMLEventAllocator;
  30 import javax.xml.stream.*;
  31 import javax.xml.stream.events.*;
  32 import javax.xml.XMLConstants;
  33 import javax.xml.namespace.QName;
  34 import com.sun.org.apache.xerces.internal.util.NamespaceContextWrapper;
  35 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
  36 import javax.xml.stream.util.XMLEventConsumer;
  37 
  38 /**
  39  * Implementation of XMLEvent Allocator.
  40  *
  41  * @author Neeraj.bajaj@sun.com, k.venugopal@sun.com
  42  */
  43 public class XMLEventAllocatorImpl implements XMLEventAllocator {
  44 
  45     /**
  46      * Creates a new instance of XMLEventAllocator
  47      */
  48     public XMLEventAllocatorImpl() {
  49     }
  50 
  51     public XMLEvent allocate(XMLStreamReader xMLStreamReader) throws XMLStreamException {
  52         if (xMLStreamReader == null) {
  53             throw new XMLStreamException("Reader cannot be null");
  54         }
  55         //        allocate is not supposed to change the state of the reader so we shouldn't be calling next.
  56         //        return getNextEvent(xMLStreamReader);
  57         return getXMLEvent(xMLStreamReader);
  58     }
  59 
  60     public void allocate(XMLStreamReader xMLStreamReader, XMLEventConsumer xMLEventConsumer)
  61             throws XMLStreamException {




  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any
  23  * questions.
  24  */
  25 package com.sun.xml.internal.stream.events;
  26 
  27 import com.sun.org.apache.xerces.internal.impl.PropertyManager;
  28 import java.util.List;
  29 import javax.xml.stream.util.XMLEventAllocator;
  30 import javax.xml.stream.*;
  31 import javax.xml.stream.events.*;
  32 import javax.xml.XMLConstants;
  33 import javax.xml.namespace.QName;
  34 import com.sun.org.apache.xerces.internal.util.NamespaceContextWrapper;
  35 import com.sun.org.apache.xerces.internal.util.NamespaceSupport;
  36 import javax.xml.stream.util.XMLEventConsumer;
  37 
  38 /**
  39  * Implementation of XMLEvent Allocator.
  40  *
  41  * @author Neeraj bajaj, k venugopal
  42  */
  43 public class XMLEventAllocatorImpl implements XMLEventAllocator {
  44 
  45     /**
  46      * Creates a new instance of XMLEventAllocator
  47      */
  48     public XMLEventAllocatorImpl() {
  49     }
  50 
  51     public XMLEvent allocate(XMLStreamReader xMLStreamReader) throws XMLStreamException {
  52         if (xMLStreamReader == null) {
  53             throw new XMLStreamException("Reader cannot be null");
  54         }
  55         //        allocate is not supposed to change the state of the reader so we shouldn't be calling next.
  56         //        return getNextEvent(xMLStreamReader);
  57         return getXMLEvent(xMLStreamReader);
  58     }
  59 
  60     public void allocate(XMLStreamReader xMLStreamReader, XMLEventConsumer xMLEventConsumer)
  61             throws XMLStreamException {


< prev index next >