jaxp/src/share/classes/javax/xml/stream/XMLEventReader.java
author ohair
Mon, 14 Apr 2008 14:52:27 -0700
changeset 311 3c14f21bf3f7
parent 6 7f561c08de6b
permissions -rw-r--r--
6484686: The next directory looks like it is no longer part of the build (deploy makefiles) Summary: Getting rid of the _OUTPUTDIR settings. Using BUILD_PARENT_DIRECTORY instead. This solves problems with the "/build/windows-i586*" paths getting mangled on Windows builds (fastdebug builds in particular). Reviewed-by: tbell
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
6
7f561c08de6b Initial load
duke
parents:
diff changeset
     1
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
     2
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
7f561c08de6b Initial load
duke
parents:
diff changeset
     3
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
     4
 * This code is free software; you can redistribute it and/or modify it
7f561c08de6b Initial load
duke
parents:
diff changeset
     5
 * under the terms of the GNU General Public License version 2 only, as
7f561c08de6b Initial load
duke
parents:
diff changeset
     6
 * published by the Free Software Foundation.  Sun designates this
7f561c08de6b Initial load
duke
parents:
diff changeset
     7
 * particular file as subject to the "Classpath" exception as provided
7f561c08de6b Initial load
duke
parents:
diff changeset
     8
 * by Sun in the LICENSE file that accompanied this code.
7f561c08de6b Initial load
duke
parents:
diff changeset
     9
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    10
 * This code is distributed in the hope that it will be useful, but WITHOUT
7f561c08de6b Initial load
duke
parents:
diff changeset
    11
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
7f561c08de6b Initial load
duke
parents:
diff changeset
    12
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
7f561c08de6b Initial load
duke
parents:
diff changeset
    13
 * version 2 for more details (a copy is included in the LICENSE file that
7f561c08de6b Initial load
duke
parents:
diff changeset
    14
 * accompanied this code).
7f561c08de6b Initial load
duke
parents:
diff changeset
    15
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    16
 * You should have received a copy of the GNU General Public License version
7f561c08de6b Initial load
duke
parents:
diff changeset
    17
 * 2 along with this work; if not, write to the Free Software Foundation,
7f561c08de6b Initial load
duke
parents:
diff changeset
    18
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
7f561c08de6b Initial load
duke
parents:
diff changeset
    19
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    20
 * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara,
7f561c08de6b Initial load
duke
parents:
diff changeset
    21
 * CA 95054 USA or visit www.sun.com if you need additional information or
7f561c08de6b Initial load
duke
parents:
diff changeset
    22
 * have any questions.
7f561c08de6b Initial load
duke
parents:
diff changeset
    23
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    24
7f561c08de6b Initial load
duke
parents:
diff changeset
    25
/*
7f561c08de6b Initial load
duke
parents:
diff changeset
    26
 * Copyright (c) 2003 by BEA Systems, Inc. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
    27
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    28
7f561c08de6b Initial load
duke
parents:
diff changeset
    29
package javax.xml.stream;
7f561c08de6b Initial load
duke
parents:
diff changeset
    30
import javax.xml.stream.events.XMLEvent;
7f561c08de6b Initial load
duke
parents:
diff changeset
    31
import java.util.Iterator;
7f561c08de6b Initial load
duke
parents:
diff changeset
    32
/**
7f561c08de6b Initial load
duke
parents:
diff changeset
    33
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    34
 * This is the top level interface for parsing XML Events.  It provides
7f561c08de6b Initial load
duke
parents:
diff changeset
    35
 * the ability to peek at the next event and returns configuration
7f561c08de6b Initial load
duke
parents:
diff changeset
    36
 * information through the property interface.
7f561c08de6b Initial load
duke
parents:
diff changeset
    37
 *
7f561c08de6b Initial load
duke
parents:
diff changeset
    38
 * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
7f561c08de6b Initial load
duke
parents:
diff changeset
    39
 * @see XMLInputFactory
7f561c08de6b Initial load
duke
parents:
diff changeset
    40
 * @see XMLEventWriter
7f561c08de6b Initial load
duke
parents:
diff changeset
    41
 * @since 1.6
7f561c08de6b Initial load
duke
parents:
diff changeset
    42
 */
7f561c08de6b Initial load
duke
parents:
diff changeset
    43
public interface XMLEventReader extends Iterator {
7f561c08de6b Initial load
duke
parents:
diff changeset
    44
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    45
   * Get the next XMLEvent
7f561c08de6b Initial load
duke
parents:
diff changeset
    46
   * @see XMLEvent
7f561c08de6b Initial load
duke
parents:
diff changeset
    47
   * @throws XMLStreamException if there is an error with the underlying XML.
7f561c08de6b Initial load
duke
parents:
diff changeset
    48
   * @throws NoSuchElementException iteration has no more elements.
7f561c08de6b Initial load
duke
parents:
diff changeset
    49
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    50
  public XMLEvent nextEvent() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    51
7f561c08de6b Initial load
duke
parents:
diff changeset
    52
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    53
   * Check if there are more events.
7f561c08de6b Initial load
duke
parents:
diff changeset
    54
   * Returns true if there are more events and false otherwise.
7f561c08de6b Initial load
duke
parents:
diff changeset
    55
   * @return true if the event reader has more events, false otherwise
7f561c08de6b Initial load
duke
parents:
diff changeset
    56
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    57
  public boolean hasNext();
7f561c08de6b Initial load
duke
parents:
diff changeset
    58
7f561c08de6b Initial load
duke
parents:
diff changeset
    59
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    60
   * Check the next XMLEvent without reading it from the stream.
7f561c08de6b Initial load
duke
parents:
diff changeset
    61
   * Returns null if the stream is at EOF or has no more XMLEvents.
7f561c08de6b Initial load
duke
parents:
diff changeset
    62
   * A call to peek() will be equal to the next return of next().
7f561c08de6b Initial load
duke
parents:
diff changeset
    63
   * @see XMLEvent
7f561c08de6b Initial load
duke
parents:
diff changeset
    64
   * @throws XMLStreamException
7f561c08de6b Initial load
duke
parents:
diff changeset
    65
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    66
  public XMLEvent peek() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    67
7f561c08de6b Initial load
duke
parents:
diff changeset
    68
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    69
   * Reads the content of a text-only element. Precondition:
7f561c08de6b Initial load
duke
parents:
diff changeset
    70
   * the current event is START_ELEMENT. Postcondition:
7f561c08de6b Initial load
duke
parents:
diff changeset
    71
   * The current event is the corresponding END_ELEMENT.
7f561c08de6b Initial load
duke
parents:
diff changeset
    72
   * @throws XMLStreamException if the current event is not a START_ELEMENT
7f561c08de6b Initial load
duke
parents:
diff changeset
    73
   * or if a non text element is encountered
7f561c08de6b Initial load
duke
parents:
diff changeset
    74
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    75
  public String getElementText() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    76
7f561c08de6b Initial load
duke
parents:
diff changeset
    77
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    78
   * Skips any insignificant space events until a START_ELEMENT or
7f561c08de6b Initial load
duke
parents:
diff changeset
    79
   * END_ELEMENT is reached. If anything other than space characters are
7f561c08de6b Initial load
duke
parents:
diff changeset
    80
   * encountered, an exception is thrown. This method should
7f561c08de6b Initial load
duke
parents:
diff changeset
    81
   * be used when processing element-only content because
7f561c08de6b Initial load
duke
parents:
diff changeset
    82
   * the parser is not able to recognize ignorable whitespace if
7f561c08de6b Initial load
duke
parents:
diff changeset
    83
   * the DTD is missing or not interpreted.
7f561c08de6b Initial load
duke
parents:
diff changeset
    84
   * @throws XMLStreamException if anything other than space characters are encountered
7f561c08de6b Initial load
duke
parents:
diff changeset
    85
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    86
  public XMLEvent nextTag() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    87
7f561c08de6b Initial load
duke
parents:
diff changeset
    88
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    89
   * Get the value of a feature/property from the underlying implementation
7f561c08de6b Initial load
duke
parents:
diff changeset
    90
   * @param name The name of the property
7f561c08de6b Initial load
duke
parents:
diff changeset
    91
   * @return The value of the property
7f561c08de6b Initial load
duke
parents:
diff changeset
    92
   * @throws IllegalArgumentException if the property is not supported
7f561c08de6b Initial load
duke
parents:
diff changeset
    93
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
    94
  public Object getProperty(java.lang.String name) throws java.lang.IllegalArgumentException;
7f561c08de6b Initial load
duke
parents:
diff changeset
    95
7f561c08de6b Initial load
duke
parents:
diff changeset
    96
  /**
7f561c08de6b Initial load
duke
parents:
diff changeset
    97
   * Frees any resources associated with this Reader.  This method does not close the
7f561c08de6b Initial load
duke
parents:
diff changeset
    98
   * underlying input source.
7f561c08de6b Initial load
duke
parents:
diff changeset
    99
   * @throws XMLStreamException if there are errors freeing associated resources
7f561c08de6b Initial load
duke
parents:
diff changeset
   100
   */
7f561c08de6b Initial load
duke
parents:
diff changeset
   101
  public void close() throws XMLStreamException;
7f561c08de6b Initial load
duke
parents:
diff changeset
   102
}