com.sun.xml.stream.events
Class StartElementEvent
java.lang.Object
com.sun.xml.stream.events.DummyEvent
com.sun.xml.stream.events.StartElementEvent
- All Implemented Interfaces:
- javax.xml.stream.events.StartElement, javax.xml.stream.events.XMLEvent, javax.xml.stream.XMLStreamConstants
public class StartElementEvent
- extends DummyEvent
- implements javax.xml.stream.events.StartElement
Implementation of StartElementEvent.
- Author:
- Neeraj Bajaj Sun Microsystems,Inc., K.Venugopal Sun Microsystems,Inc.
Fields inherited from interface 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 |
Methods inherited from class com.sun.xml.stream.events.DummyEvent |
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacterData, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, setEventType |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface javax.xml.stream.events.XMLEvent |
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement |
StartElementEvent
public StartElementEvent(java.lang.String prefix,
java.lang.String uri,
java.lang.String localpart)
StartElementEvent
public StartElementEvent(javax.xml.namespace.QName qname)
StartElementEvent
public StartElementEvent(javax.xml.stream.events.StartElement startelement)
init
protected void init()
getName
public javax.xml.namespace.QName getName()
- Specified by:
getName
in interface javax.xml.stream.events.StartElement
setName
public void setName(javax.xml.namespace.QName qname)
getAttributes
public java.util.Iterator getAttributes()
- Specified by:
getAttributes
in interface javax.xml.stream.events.StartElement
getNamespaces
public java.util.Iterator getNamespaces()
- Specified by:
getNamespaces
in interface javax.xml.stream.events.StartElement
getAttributeByName
public javax.xml.stream.events.Attribute getAttributeByName(javax.xml.namespace.QName qname)
- Specified by:
getAttributeByName
in interface javax.xml.stream.events.StartElement
getNamespace
public java.lang.String getNamespace()
getNamespaceURI
public java.lang.String getNamespaceURI(java.lang.String prefix)
- Specified by:
getNamespaceURI
in interface javax.xml.stream.events.StartElement
toString
public java.lang.String toString()
- Overrides:
toString
in class java.lang.Object
nameAsString
public java.lang.String nameAsString()
- Return this event as String
- Returns:
- String Event returned as string.
getNamespaceContext
public javax.xml.namespace.NamespaceContext getNamespaceContext()
- Gets a read-only namespace context. If no context is
available this method will return an empty namespace context.
The NamespaceContext contains information about all namespaces
in scope for this StartElement.
- Specified by:
getNamespaceContext
in interface javax.xml.stream.events.StartElement
- Returns:
- the current namespace context
setNamespaceContext
public void setNamespaceContext(javax.xml.namespace.NamespaceContext nc)
writeAsEncodedUnicode
public void writeAsEncodedUnicode(java.io.Writer writer)
throws javax.xml.stream.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.
- Specified by:
writeAsEncodedUnicode
in interface javax.xml.stream.events.XMLEvent
- Overrides:
writeAsEncodedUnicode
in class DummyEvent
- Parameters:
writer
- The writer that will output the data
- Throws:
XMLStreamException
- if there is a fatal error writing the event
Copyright ? 2002-2003 Apache XML Project. All Rights Reserved.