XMLEventConsumer (Java EE 5)

Java EE API


javax.xml.stream.util Interface XMLEventConsumer

All Known Subinterfaces:
XMLEventWriter

public interface XMLEventConsumer

Implemented by: XMLEventWriter

此接口定义了一个事件使用者接口。使用者接口的协定将用于接受事件。此接口可用于将对象标记为可以接收事件。add 方法可能被连续调用几次,因此,使用者必须能够缓存尚未处理的事件。
英文文档:

This interface defines an event consumer interface. The contract of the of a consumer is to accept the event. This interface can be used to mark an object as able to receive events. Add may be called several times in immediate succession so a consumer must be able to cache events it hasn't processed yet.

Version:
1.0
Author:
Copyright (c) 2003 by BEA Systems. All Rights Reserved.

Method Summary
 void
 

Method Detail

public void add(XMLEvent event) throws XMLStreamException
此方法为使用者添加一个事件。调用此方法会使 event 参数失效。客户端应用程序应该在调用 add 方法时放弃对此事件的所有引用。应用程序继续使用这些引用的行为是未定义的。
event 要添加的事件,不可以为 null
英文文档:

add

void add(XMLEvent event)
         throws XMLStreamException
This method adds an event to the consumer. Calling this method invalidates the event parameter. The client application should discard all references to this event upon calling add. The behavior of an application that continues to use such references is undefined.

Parameters:
event - the event to add, may not be null
Throws:
XMLStreamException


Submit a bug or feature

Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

一看就知道只有菜鸟才干这么无知的事啦。

PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!