本文整理汇总了Java中javax.xml.stream.util.XMLEventConsumer类的典型用法代码示例。如果您正苦于以下问题:Java XMLEventConsumer类的具体用法?Java XMLEventConsumer怎么用?Java XMLEventConsumer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
XMLEventConsumer类属于javax.xml.stream.util包,在下文中一共展示了XMLEventConsumer类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: allocate
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
public void allocate(XMLStreamReader xMLStreamReader, XMLEventConsumer xMLEventConsumer)
throws XMLStreamException {
XMLEvent currentEvent = getXMLEvent(xMLStreamReader);
if (currentEvent != null) {
xMLEventConsumer.add(currentEvent);
}
return;
}
示例2: addEventsTo
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
/**
* 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;
}
示例3: allocate
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
@Override
public void allocate(XMLStreamReader reader, XMLEventConsumer consumer) throws XMLStreamException {
xmlEventAllocator.allocate(reader, consumer);
}
示例4: allocate
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
public void allocate(XMLStreamReader reader, XMLEventConsumer consumer)
throws XMLStreamException
{
consumer.add(allocate(reader));
}
示例5: allocate
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
@Override
public void allocate(XMLStreamReader r, XMLEventConsumer consumer)
throws XMLStreamException
{
consumer.add(allocate(r));
}
示例6: allocate
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
/**
* 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));
}
示例7: StaxEventContentHandler
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
/**
* 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;
}
示例8: StaxEventContentHandler
import javax.xml.stream.util.XMLEventConsumer; //导入依赖的package包/类
/**
* 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;
}