Class XMLEventAllocatorBase

  • All Implemented Interfaces:
    javax.xml.stream.util.XMLEventAllocator

    public class XMLEventAllocatorBase
    extends java.lang.Object
    implements javax.xml.stream.util.XMLEventAllocator

    An allocator that creates an event per method call.

    • Method Summary

      All Methods Static Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      javax.xml.stream.events.XMLEvent allocate​(javax.xml.stream.XMLStreamReader reader)
      This method allocates an event given the current state of the XMLStreamReader.
      void allocate​(javax.xml.stream.XMLStreamReader reader, javax.xml.stream.util.XMLEventConsumer consumer)
      This method allocates an event or set of events given the current state of the XMLStreamReader and adds the event or set of events to the consumer that was passed in.
      javax.xml.stream.events.Characters allocateCData​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.Characters allocateCharacters​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.Comment allocateComment​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.DTD allocateDTD​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.EndDocument allocateEndDocument​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.EndElement allocateEndElement​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.EntityReference allocateEntityReference​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.ProcessingInstruction allocatePI​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.Characters allocateSpace​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.StartDocument allocateStartDocument​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.StartElement allocateStartElement​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.events.StartDocument allocateXMLDeclaration​(javax.xml.stream.XMLStreamReader reader)  
      static java.util.Iterator getAttributes​(javax.xml.stream.XMLStreamReader reader)  
      static java.util.Iterator getNamespaces​(javax.xml.stream.XMLStreamReader reader)  
      javax.xml.stream.util.XMLEventAllocator newInstance()
      This method creates an instance of the XMLEventAllocator.
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • XMLEventAllocatorBase

        public XMLEventAllocatorBase()
    • Method Detail

      • newInstance

        public javax.xml.stream.util.XMLEventAllocator newInstance()
        Description copied from interface: javax.xml.stream.util.XMLEventAllocator
        This method creates an instance of the XMLEventAllocator. This allows the XMLInputFactory to allocate a new instance per reader.
        Specified by:
        newInstance in interface javax.xml.stream.util.XMLEventAllocator
      • getAttributes

        public static java.util.Iterator getAttributes​(javax.xml.stream.XMLStreamReader reader)
      • getNamespaces

        public static java.util.Iterator getNamespaces​(javax.xml.stream.XMLStreamReader reader)
      • allocateStartElement

        public javax.xml.stream.events.StartElement allocateStartElement​(javax.xml.stream.XMLStreamReader reader)
                                                                  throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateEndElement

        public javax.xml.stream.events.EndElement allocateEndElement​(javax.xml.stream.XMLStreamReader reader)
                                                              throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateCharacters

        public javax.xml.stream.events.Characters allocateCharacters​(javax.xml.stream.XMLStreamReader reader)
                                                              throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateCData

        public javax.xml.stream.events.Characters allocateCData​(javax.xml.stream.XMLStreamReader reader)
                                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateSpace

        public javax.xml.stream.events.Characters allocateSpace​(javax.xml.stream.XMLStreamReader reader)
                                                         throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateEntityReference

        public javax.xml.stream.events.EntityReference allocateEntityReference​(javax.xml.stream.XMLStreamReader reader)
                                                                        throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocatePI

        public javax.xml.stream.events.ProcessingInstruction allocatePI​(javax.xml.stream.XMLStreamReader reader)
                                                                 throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateComment

        public javax.xml.stream.events.Comment allocateComment​(javax.xml.stream.XMLStreamReader reader)
                                                        throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateStartDocument

        public javax.xml.stream.events.StartDocument allocateStartDocument​(javax.xml.stream.XMLStreamReader reader)
                                                                    throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateEndDocument

        public javax.xml.stream.events.EndDocument allocateEndDocument​(javax.xml.stream.XMLStreamReader reader)
                                                                throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateDTD

        public javax.xml.stream.events.DTD allocateDTD​(javax.xml.stream.XMLStreamReader reader)
                                                throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocateXMLDeclaration

        public javax.xml.stream.events.StartDocument allocateXMLDeclaration​(javax.xml.stream.XMLStreamReader reader)
                                                                     throws javax.xml.stream.XMLStreamException
        Throws:
        javax.xml.stream.XMLStreamException
      • allocate

        public javax.xml.stream.events.XMLEvent allocate​(javax.xml.stream.XMLStreamReader reader)
                                                  throws javax.xml.stream.XMLStreamException
        Description copied from interface: javax.xml.stream.util.XMLEventAllocator
        This method allocates an event given the current state of the XMLStreamReader. If this XMLEventAllocator does not have a one-to-one mapping between reader states and events this method will return null. This method must not modify the state of the XMLStreamReader.
        Specified by:
        allocate in interface javax.xml.stream.util.XMLEventAllocator
        Parameters:
        reader - The XMLStreamReader to allocate from
        Returns:
        the event corresponding to the current reader state
        Throws:
        javax.xml.stream.XMLStreamException
      • allocate

        public void allocate​(javax.xml.stream.XMLStreamReader reader,
                             javax.xml.stream.util.XMLEventConsumer consumer)
                      throws javax.xml.stream.XMLStreamException
        Description copied from interface: javax.xml.stream.util.XMLEventAllocator
        This method allocates an event or set of events given the current state of the XMLStreamReader and adds the event or set of events to the consumer that was passed in. This method can be used to expand or contract reader states into event states. This method may modify the state of the XMLStreamReader.
        Specified by:
        allocate in interface javax.xml.stream.util.XMLEventAllocator
        Parameters:
        reader - The XMLStreamReader to allocate from
        consumer - The XMLEventConsumer to add to.
        Throws:
        javax.xml.stream.XMLStreamException
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object