This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.


javax.xml.stream.events
interface XMLEvent

All Superinterfaces:
XMLStreamConstants
All Known Subinterfaces:
Attribute, Characters, Comment, DTD, EndDocument, EndElement, EntityDeclaration, EntityReference, NotationDeclaration, ProcessingInstruction, StartDocument, StartElement, Namespace

Most common ways to construct:

XMLEventReader r = …;

XMLEvent event = r.nextEvent();

Based on 45 examples

 

XMLEventReader reader = …;

XMLEvent event = reader.peek();

Based on 34 examples


public interface XMLEvent
extends XMLStreamConstants

This is the base event interface for handling markup events. Events are value objects that are used to communicate the XML 1.0 InfoSet to the Application. Events may be cached and referenced after the parse has completed.


Field Summary
 
Fields inherited from class javax.xml.stream.XMLStreamConstants
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
 
Method Summary
 Characters

          Returns this event as Characters, may result in a class cast exception if this event is not Characters.
 EndElement

          Returns this event as an end element event, may result in a class cast exception if this event is not a end element.
 StartElement

          Returns this event as a start element event, may result in a class cast exception if this event is not a start element.
 int

          Returns an integer code for this event.
 Location

          Return the location of this event.
 QName

          This method is provided for implementations to provide optional type information about the associated event.
 boolean

          A utility function to check if this event is an Attribute.
 boolean

          A utility function to check if this event is Characters.
 boolean

          A utility function to check if this event is an EndDocument.
 boolean

          A utility function to check if this event is a EndElement.
 boolean

          A utility function to check if this event is an EntityReference.
 boolean

          A utility function to check if this event is a Namespace.
 boolean

          A utility function to check if this event is a ProcessingInstruction.
 boolean

          A utility function to check if this event is a StartDocument.
 boolean

          A utility function to check if this event is a StartElement.
 void

          This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters.
 

Method Detail

asCharacters

public Characters asCharacters()
Returns this event as Characters, may result in a class cast exception if this event is not Characters.


asEndElement

public EndElement asEndElement()
Returns this event as an end element event, may result in a class cast exception if this event is not a end element.


asStartElement

public StartElement asStartElement()
Returns this event as a start element event, may result in a class cast exception if this event is not a start element.


getEventType

public int getEventType()
Returns an integer code for this event.


getLocation

public Location getLocation()
Return the location of this event. The Location returned from this method is non-volatile and will retain its information.


getSchemaType

public QName getSchemaType()
This method is provided for implementations to provide optional type information about the associated event. It is optional and will return null if no information is available.


isAttribute

public boolean isAttribute()
A utility function to check if this event is an Attribute.


isCharacters

public boolean isCharacters()
A utility function to check if this event is Characters.


isEndDocument

public boolean isEndDocument()
A utility function to check if this event is an EndDocument.


isEndElement

public boolean isEndElement()
A utility function to check if this event is a EndElement.


isEntityReference

public boolean isEntityReference()
A utility function to check if this event is an EntityReference.


isNamespace

public boolean isNamespace()
A utility function to check if this event is a Namespace.


isProcessingInstruction

public boolean isProcessingInstruction()
A utility function to check if this event is a ProcessingInstruction.


isStartDocument

public boolean isStartDocument()
A utility function to check if this event is a StartDocument.


isStartElement

public boolean isStartElement()
A utility function to check if this event is a StartElement.


writeAsEncodedUnicode

public void writeAsEncodedUnicode(Writer writer)
                           throws XMLStreamException
This method will write the XMLEvent as per the XML 1.0 specification as Unicode characters. No indentation or whitespace should be outputted. Any user defined event type SHALL have this method called when being written to on an output stream. Built in Event types MUST implement this method, but implementations MAY choose not call these methods for optimizations reasons when writing out built in Events to an output stream. The output generated MUST be equivalent in terms of the infoset expressed.

Parameters:
writer - The writer that will output the data
Throws:
XMLStreamException


This documentation differs from the official API. Jadeite adds extra features to the API including: variable font sizes, constructions examples, placeholders for classes and methods, and auto-generated “See Also” links. Additionally it is missing some items found in standard Javadoc documentation, including: generics type information, “Deprecated” tags and comments, “See Also” links, along with other minor differences. Please send any questions or feedback to bam@cs.cmu.edu.
This page displays the Jadeite version of the documention, which is derived from the offical documentation that contains this copyright notice:
Copyright 2008 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.
The official Sun™ documentation can be found here at http://java.sun.com/javase/6/docs/api/.