XMLEvent
, XMLStreamConstants
public interface StartElement extends XMLEvent
ATTRIBUTE, CDATA, CHARACTERS, COMMENT, DTD, END_DOCUMENT, END_ELEMENT, ENTITY_DECLARATION, ENTITY_REFERENCE, NAMESPACE, NOTATION_DECLARATION, PROCESSING_INSTRUCTION, SPACE, START_DOCUMENT, START_ELEMENT
Modifier and Type | Method | Description |
---|---|---|
Attribute |
getAttributeByName |
Returns the attribute referred to by the qname. |
Iterator |
getAttributes() |
Returns an Iterator of non-namespace attributes declared on this START_ELEMENT. |
QName |
getName() |
Get the name of this event |
NamespaceContext |
getNamespaceContext() |
Gets a read-only namespace context. |
Iterator |
getNamespaces() |
Returns an Iterator of namespaces declared on this element. |
String |
getNamespaceURI |
Gets the value that the prefix is bound to in the context of this element. |
asCharacters, asEndElement, asStartElement, getEventType, getLocation, getSchemaType, isAttribute, isCharacters, isEndDocument, isEndElement, isEntityReference, isNamespace, isProcessingInstruction, isStartDocument, isStartElement, writeAsEncodedUnicode
QName getName()
Iterator<Attribute> getAttributes()
Attribute
interface. Attributes are fundamentally unordered and may be reported in any order.Iterator<Namespace> getNamespaces()
The iterator must contain only implementations of the Namespace
interface.
A Namespace
is an Attribute
. One can iterate over a list of namespaces as a list of attributes. However this method returns only the list of namespaces declared on this START_ELEMENT and does not include the attributes declared on this START_ELEMENT. Returns an empty iterator if there are no namespaces.
Attribute getAttributeByName(QName name)
name
- the qname of the desired attributeNamespaceContext getNamespaceContext()
String getNamespaceURI(String prefix)
prefix
- the prefix to lookup
© 1993, 2023, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/21/docs/api/java.xml/javax/xml/stream/events/StartElement.html