Path: blob/jdk8u272-b10-aarch32-20201026/jaxp/src/javax/xml/stream/events/StartElement.java
48792 views
/*1* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.2*3* This code is free software; you can redistribute it and/or modify it4* under the terms of the GNU General Public License version 2 only, as5* published by the Free Software Foundation. Oracle designates this6* particular file as subject to the "Classpath" exception as provided7* by Oracle in the LICENSE file that accompanied this code.8*9* This code is distributed in the hope that it will be useful, but WITHOUT10* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or11* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License12* version 2 for more details (a copy is included in the LICENSE file that13* accompanied this code).14*15* You should have received a copy of the GNU General Public License version16* 2 along with this work; if not, write to the Free Software Foundation,17* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.18*19* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA20* or visit www.oracle.com if you need additional information or have any21* questions.22*/2324/*25* Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.26*/2728package javax.xml.stream.events;2930import javax.xml.namespace.QName;31import javax.xml.namespace.NamespaceContext;3233import java.util.Map;34import java.util.Iterator;3536/**37* The StartElement interface provides access to information about38* start elements. A StartElement is reported for each Start Tag39* in the document.40*41* @version 1.042* @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.43* @since 1.644*/45public interface StartElement extends XMLEvent {4647/**48* Get the name of this event49* @return the qualified name of this event50*/51public QName getName();5253/**54* Returns an Iterator of non-namespace declared attributes declared on55* this START_ELEMENT,56* returns an empty iterator if there are no attributes. The57* iterator must contain only implementations of the javax.xml.stream.Attribute58* interface. Attributes are fundamentally unordered and may not be reported59* in any order.60*61* @return a readonly Iterator over Attribute interfaces, or an62* empty iterator63*/64public Iterator getAttributes();6566/**67* Returns an Iterator of namespaces declared on this element.68* This Iterator does not contain previously declared namespaces69* unless they appear on the current START_ELEMENT.70* Therefore this list may contain redeclared namespaces and duplicate namespace71* declarations. Use the getNamespaceContext() method to get the72* current context of namespace declarations.73*74* <p>The iterator must contain only implementations of the75* javax.xml.stream.Namespace interface.76*77* <p>A Namespace isA Attribute. One78* can iterate over a list of namespaces as a list of attributes.79* However this method returns only the list of namespaces80* declared on this START_ELEMENT and does not81* include the attributes declared on this START_ELEMENT.82*83* Returns an empty iterator if there are no namespaces.84*85* @return a readonly Iterator over Namespace interfaces, or an86* empty iterator87*88*/89public Iterator getNamespaces();9091/**92* Returns the attribute referred to by this name93* @param name the qname of the desired name94* @return the attribute corresponding to the name value or null95*/96public Attribute getAttributeByName(QName name);9798/**99* Gets a read-only namespace context. If no context is100* available this method will return an empty namespace context.101* The NamespaceContext contains information about all namespaces102* in scope for this StartElement.103*104* @return the current namespace context105*/106public NamespaceContext getNamespaceContext();107108/**109* Gets the value that the prefix is bound to in the110* context of this element. Returns null if111* the prefix is not bound in this context112* @param prefix the prefix to lookup113* @return the uri bound to the prefix or null114*/115public String getNamespaceURI(String prefix);116}117118119