當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。