当前位置: 首页>>代码示例>>Java>>正文


Java XMLEvent.END_DOCUMENT属性代码示例

本文整理汇总了Java中javax.xml.stream.events.XMLEvent.END_DOCUMENT属性的典型用法代码示例。如果您正苦于以下问题:Java XMLEvent.END_DOCUMENT属性的具体用法?Java XMLEvent.END_DOCUMENT怎么用?Java XMLEvent.END_DOCUMENT使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在javax.xml.stream.events.XMLEvent的用法示例。


在下文中一共展示了XMLEvent.END_DOCUMENT属性的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: findNextEvent

private int findNextEvent() throws XMLStreamException {
    fStreamAdvancedByHasNext = false;
    while(fStreamReader.hasNext()){
        fCurrentEvent = fStreamReader.next();
        if(fStreamFilter.accept(fStreamReader)){
            fEventAccepted = true;
            return fCurrentEvent;
        }
    }
    //although it seems that IllegalStateException should be thrown when next() is called
    //on a stream that has no more items, we have to assume END_DOCUMENT is always accepted
    //in order to pass the TCK
    if (fCurrentEvent == XMLEvent.END_DOCUMENT)
        return fCurrentEvent;
    else
        return -1;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:XMLStreamFilterImpl.java

示例2: seek

/**
 * Seek to an identifier in this stream.
 *
 * @param id The identifier to find.
 * @return This {@code FreeColXMLReader} positioned such that the
 *     required identifier is current, or null on error or if not found.
 * @exception XMLStreamException if a problem was encountered
 *     during parsing.
 */
public FreeColXMLReader seek(String id) throws XMLStreamException {
    nextTag();
    for (int type = getEventType(); type != XMLEvent.END_DOCUMENT;
         type = getEventType()) {
        if (type == XMLEvent.START_ELEMENT
            && id.equals(readId())) return this;
        nextTag();
    }
    return null;
}
 
开发者ID:FreeCol,项目名称:freecol,代码行数:19,代码来源:FreeColXMLReader.java

示例3: findNextTag

private int findNextTag() throws XMLStreamException {
    fStreamAdvancedByHasNext = false;
    while(fStreamReader.hasNext()){
        fCurrentEvent = fStreamReader.nextTag();
        if(fStreamFilter.accept(fStreamReader)){
            fEventAccepted = true;
            return fCurrentEvent;
        }
    }
    if (fCurrentEvent == XMLEvent.END_DOCUMENT)
        return fCurrentEvent;
    else
        return -1;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:14,代码来源:XMLStreamFilterImpl.java

示例4: hasNext

/**
 * @throws XMLStreamException
 * @return
 */
public boolean hasNext() throws XMLStreamException {
    //the scanner returns -1 when it detects a broken stream
    if (fEventType == -1) return false;
    //we can check in scanners if the scanner state is not set to
    //terminating, we still have more events.
    return fEventType != XMLEvent.END_DOCUMENT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:11,代码来源:XMLStreamReaderImpl.java

示例5: getEventTypeString

final static String getEventTypeString(int eventType) {
    switch (eventType){
        case XMLEvent.START_ELEMENT:
            return "START_ELEMENT";
        case XMLEvent.END_ELEMENT:
            return "END_ELEMENT";
        case XMLEvent.PROCESSING_INSTRUCTION:
            return "PROCESSING_INSTRUCTION";
        case XMLEvent.CHARACTERS:
            return "CHARACTERS";
        case XMLEvent.COMMENT:
            return "COMMENT";
        case XMLEvent.START_DOCUMENT:
            return "START_DOCUMENT";
        case XMLEvent.END_DOCUMENT:
            return "END_DOCUMENT";
        case XMLEvent.ENTITY_REFERENCE:
            return "ENTITY_REFERENCE";
        case XMLEvent.ATTRIBUTE:
            return "ATTRIBUTE";
        case XMLEvent.DTD:
            return "DTD";
        case XMLEvent.CDATA:
            return "CDATA";
        case XMLEvent.SPACE:
            return "SPACE";
    }
    return "UNKNOWN_EVENT_TYPE, " + String.valueOf(eventType);
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:29,代码来源:XMLStreamReaderImpl.java

示例6: hasNext

/**
 * @throws XMLStreamException
 * @return
 */
public boolean hasNext() throws XMLStreamException {
    //the scanner returns -1 when it detects a broken stream
    if (fEventType == -1) {
        return false;
    }
    //we can check in scanners if the scanner state is not set to
    //terminating, we still have more events.
    return fEventType != XMLEvent.END_DOCUMENT;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:XMLStreamReaderImpl.java

示例7: getEventTypeString

final static String getEventTypeString(int eventType) {
    switch (eventType) {
        case XMLEvent.START_ELEMENT:
            return "START_ELEMENT";
        case XMLEvent.END_ELEMENT:
            return "END_ELEMENT";
        case XMLEvent.PROCESSING_INSTRUCTION:
            return "PROCESSING_INSTRUCTION";
        case XMLEvent.CHARACTERS:
            return "CHARACTERS";
        case XMLEvent.COMMENT:
            return "COMMENT";
        case XMLEvent.START_DOCUMENT:
            return "START_DOCUMENT";
        case XMLEvent.END_DOCUMENT:
            return "END_DOCUMENT";
        case XMLEvent.ENTITY_REFERENCE:
            return "ENTITY_REFERENCE";
        case XMLEvent.ATTRIBUTE:
            return "ATTRIBUTE";
        case XMLEvent.DTD:
            return "DTD";
        case XMLEvent.CDATA:
            return "CDATA";
        case XMLEvent.SPACE:
            return "SPACE";
    }
    return "UNKNOWN_EVENT_TYPE, " + String.valueOf(eventType);
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:29,代码来源:XMLStreamReaderImpl.java

示例8: testNextEvent

private static void testNextEvent(int max)
        throws IOException, XMLStreamException {
    System.out.println("\nTest nextEvent (" + max + ")...");
    XMLEventReader reader = createXmlReader(max);
    XMLEvent event;
    do {
        event = reader.nextEvent();
        System.out.println(event);
    } while (event.getEventType() != XMLEvent.END_DOCUMENT);
    System.out.println("nextEvent passed\n");
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:11,代码来源:EventFilterSupportTest.java

示例9: isEndDocument

public boolean isEndDocument() {
    return fEventType == XMLEvent.END_DOCUMENT;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:3,代码来源:DummyEvent.java


注:本文中的javax.xml.stream.events.XMLEvent.END_DOCUMENT属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。