|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
javax.xml.stream.util Class EventReaderDelegate
java.lang.Object javax.xml.stream.util.EventReaderDelegate
- All Implemented Interfaces:
- Iterator, XMLEventReader
public class EventReaderDelegate
- extends Object
- implements XMLEventReader
Implements:
XMLEventReader
该类是用于派生 XMLEventReader 过滤器的基类。 此类设计用于 XMLEventReader 和应用程序的 XMLEventReader 之间。默认情况下,每种方法除了调用父接口中的相应方法之外,不执行任何操作。
version | 1.0 |
See also | javax.xml.stream.XMLEventReader, javax.xml.stream.util.StreamReaderDelegate |
This is the base class for deriving an XMLEventReader filter. This class is designed to sit between an XMLEventReader and an application's XMLEventReader. By default each method does nothing but call the corresponding method on the parent interface.
- Version:
- 1.0
- Author:
- Copyright (c) 2003 by BEA Systems. All Rights Reserved.
- See Also:
XMLEventReader
,StreamReaderDelegate
Constructor Summary | |
---|---|
EventReaderDelegate()
Construct an empty filter with no parent. |
|
EventReaderDelegate(XMLEventReader reader)
Construct an filter with the specified parent. |
Method Summary | |
---|---|
void |
close()
Frees any resources associated with this Reader. |
String |
getElementText()
Reads the content of a text-only element. |
XMLEventReader |
getParent()
Get the parent of this instance. |
Object |
getProperty(String name)
Get the value of a feature/property from the underlying implementation |
boolean |
hasNext()
Check if there are more events. |
Object |
next()
|
XMLEvent |
nextEvent()
Get the next XMLEvent |
XMLEvent |
nextTag()
Skips any insignificant space events until a START_ELEMENT or END_ELEMENT is reached. |
XMLEvent |
peek()
Check the next XMLEvent without reading it from the stream. |
void |
remove()
|
void |
setParent(XMLEventReader reader)
Set the parent of this instance. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public
EventReaderDelegate()
构造没有父过滤器的空过滤器。
英文文档:
EventReaderDelegate
public EventReaderDelegate()
- Construct an empty filter with no parent.
public
EventReaderDelegate(XMLEventReader reader)
用指定的父过滤器来构造一个过滤器。
reader | 父级 |
EventReaderDelegate
public EventReaderDelegate(XMLEventReader reader)
- Construct an filter with the specified parent.
- Parameters:
reader
- the parent
Method Detail |
---|
public void
setParent(XMLEventReader reader)
设置此实例的父实例。
reader | 新的父实例 |
setParent
public void setParent(XMLEventReader reader)
- Set the parent of this instance.
- Parameters:
reader
- the new parent
public XMLEventReader
getParent()
获取此实例的父实例。
return | 父实例;如果没有设置父实例,则返回 null |
getParent
public XMLEventReader getParent()
- Get the parent of this instance.
- Returns:
- the parent or null if none is set
public XMLEvent
nextEvent() throws XMLStreamException
英文文档:
nextEvent
public XMLEvent nextEvent() throws XMLStreamException
- Description copied from interface:
XMLEventReader
- Get the next XMLEvent
- Specified by:
nextEvent
in interfaceXMLEventReader
- Throws:
XMLStreamException
- if there is an error with the underlying XML.- See Also:
XMLEvent
public Object
next()
英文文档:
next
public Object next()
public boolean
hasNext()
英文文档:
hasNext
public boolean hasNext()
- Description copied from interface:
XMLEventReader
- Check if there are more events.
Returns true if there are more events and false otherwise.
- Specified by:
hasNext
in interfaceIterator
- Specified by:
hasNext
in interfaceXMLEventReader
- Returns:
- true if the event reader has more events, false otherwise
public XMLEvent
peek() throws XMLStreamException
英文文档:
peek
public XMLEvent peek() throws XMLStreamException
- Description copied from interface:
XMLEventReader
- Check the next XMLEvent without reading it from the stream.
Returns null if the stream is at EOF or has no more XMLEvents.
A call to peek() will be equal to the next return of next().
- Specified by:
peek
in interfaceXMLEventReader
- Throws:
XMLStreamException
- See Also:
XMLEvent
public void
close() throws XMLStreamException
英文文档:
close
public void close() throws XMLStreamException
- Description copied from interface:
XMLEventReader
- Frees any resources associated with this Reader. This method does not close the
underlying input source.
- Specified by:
close
in interfaceXMLEventReader
- Throws:
XMLStreamException
- if there are errors freeing associated resources
public String
getElementText() throws XMLStreamException
英文文档:
getElementText
public String getElementText() throws XMLStreamException
- Description copied from interface:
XMLEventReader
- Reads the content of a text-only element. Precondition:
the current event is START_ELEMENT. Postcondition:
The current event is the corresponding END_ELEMENT.
- Specified by:
getElementText
in interfaceXMLEventReader
- Throws:
XMLStreamException
- if the current event is not a START_ELEMENT or if a non text element is encountered
public XMLEvent
nextTag() throws XMLStreamException
英文文档:
nextTag
public XMLEvent nextTag() throws XMLStreamException
- Description copied from interface:
XMLEventReader
- Skips any insignificant space events until a START_ELEMENT or
END_ELEMENT is reached. If anything other than space characters are
encountered, an exception is thrown. This method should
be used when processing element-only content because
the parser is not able to recognize ignorable whitespace if
the DTD is missing or not interpreted.
- Specified by:
nextTag
in interfaceXMLEventReader
- Throws:
XMLStreamException
- if anything other than space characters are encountered
public Object
getProperty(String name) throws IllegalArgumentException
英文文档:
getProperty
public Object getProperty(String name) throws IllegalArgumentException
- Description copied from interface:
XMLEventReader
- Get the value of a feature/property from the underlying implementation
- Specified by:
getProperty
in interfaceXMLEventReader
- Parameters:
name
- The name of the property- Returns:
- The value of the property
- Throws:
IllegalArgumentException
- if the property is not supported
public void
remove()
英文文档:
remove
public void remove()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Submit a bug or feature
Copyright 2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.
PS : 未经我党受权你也可自由散发此文档。 如有任何错误请自行修正;若因此而造成任何损失请直接找人民主席,请勿与本人联系。谢谢!