public void allocate(XMLStreamReader xMLStreamReader, XMLEventConsumer xMLEventConsumer) throws XMLStreamException { XMLEvent currentEvent = getXMLEvent(xMLStreamReader); if (currentEvent != null) { xMLEventConsumer.add(currentEvent); } return; }
/** * Adds the {@link XMLEvent}s in this stockpile to an {@link XMLEventConsumer}. * @param consumer The {@link XMLEventConsumer} to add the {@link XMLEvent}s to. * @return The {@link Stockpile} instance for chaining. * @throws XMLStreamException If an XML error occurs. */ public Stockpile addEventsTo(XMLEventConsumer consumer) throws XMLStreamException { for (XMLEvent event : events) { consumer.add(event); } return this; }
@Override public void allocate(XMLStreamReader reader, XMLEventConsumer consumer) throws XMLStreamException { xmlEventAllocator.allocate(reader, consumer); }
public void allocate(XMLStreamReader reader, XMLEventConsumer consumer) throws XMLStreamException { consumer.add(allocate(reader)); }
@Override public void allocate(XMLStreamReader r, XMLEventConsumer consumer) throws XMLStreamException { consumer.add(allocate(r)); }
/** * 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. * @param streamReader The XMLStreamReader to allocate from * @param consumer The XMLEventConsumer to add to. */ public void allocate(XMLStreamReader streamReader, XMLEventConsumer consumer) throws XMLStreamException { consumer.add(getXMLEvent(streamReader)); }
/** * Construct a new instance of the {@code StaxEventContentHandler} that writes to the given * {@code XMLEventConsumer}. A default {@code XMLEventFactory} will be created. * * @param consumer the consumer to write events to */ StaxEventContentHandler(XMLEventConsumer consumer) { this.eventFactory = XMLEventFactory.newInstance(); this.eventConsumer = consumer; }
/** * Construct a new instance of the {@code StaxEventContentHandler} that uses the given * event factory to create events and writes to the given {@code XMLEventConsumer}. * * @param consumer the consumer to write events to * @param factory the factory used to create events */ StaxEventContentHandler(XMLEventConsumer consumer, XMLEventFactory factory) { this.eventFactory = factory; this.eventConsumer = consumer; }
/** * Construct a new instance of the {@code StaxEventContentHandler} that writes to the given * {@code XMLEventConsumer}. A default {@code XMLEventFactory} will be created. * @param consumer the consumer to write events to */ StaxEventContentHandler(XMLEventConsumer consumer) { this.eventFactory = XMLEventFactory.newInstance(); this.eventConsumer = consumer; }
/** * Construct a new instance of the {@code StaxEventContentHandler} that uses the given * event factory to create events and writes to the given {@code XMLEventConsumer}. * @param consumer the consumer to write events to * @param factory the factory used to create events */ StaxEventContentHandler(XMLEventConsumer consumer, XMLEventFactory factory) { this.eventFactory = factory; this.eventConsumer = consumer; }