12005
|
1 |
/*
|
|
2 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
3 |
*
|
|
4 |
* This code is free software; you can redistribute it and/or modify it
|
|
5 |
* under the terms of the GNU General Public License version 2 only, as
|
|
6 |
* published by the Free Software Foundation. Oracle designates this
|
|
7 |
* particular file as subject to the "Classpath" exception as provided
|
|
8 |
* by Oracle in the LICENSE file that accompanied this code.
|
|
9 |
*
|
|
10 |
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
11 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
12 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
13 |
* version 2 for more details (a copy is included in the LICENSE file that
|
|
14 |
* accompanied this code).
|
|
15 |
*
|
|
16 |
* You should have received a copy of the GNU General Public License version
|
|
17 |
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
18 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
19 |
*
|
|
20 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
21 |
* or visit www.oracle.com if you need additional information or have any
|
|
22 |
* questions.
|
|
23 |
*/
|
|
24 |
|
|
25 |
/*
|
|
26 |
* Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
|
|
27 |
*/
|
|
28 |
|
|
29 |
package javax.xml.stream.events;
|
|
30 |
|
|
31 |
import javax.xml.namespace.QName;
|
|
32 |
import javax.xml.namespace.NamespaceContext;
|
|
33 |
|
|
34 |
import java.util.Map;
|
|
35 |
import java.util.Iterator;
|
|
36 |
|
|
37 |
/**
|
|
38 |
* The StartElement interface provides access to information about
|
|
39 |
* start elements. A StartElement is reported for each Start Tag
|
|
40 |
* in the document.
|
|
41 |
*
|
|
42 |
* @version 1.0
|
|
43 |
* @author Copyright (c) 2009 by Oracle Corporation. All Rights Reserved.
|
|
44 |
* @since 1.6
|
|
45 |
*/
|
|
46 |
public interface StartElement extends XMLEvent {
|
|
47 |
|
|
48 |
/**
|
|
49 |
* Get the name of this event
|
|
50 |
* @return the qualified name of this event
|
|
51 |
*/
|
|
52 |
public QName getName();
|
|
53 |
|
|
54 |
/**
|
|
55 |
* Returns an Iterator of non-namespace declared attributes declared on
|
|
56 |
* this START_ELEMENT,
|
|
57 |
* returns an empty iterator if there are no attributes. The
|
|
58 |
* iterator must contain only implementations of the javax.xml.stream.Attribute
|
|
59 |
* interface. Attributes are fundamentally unordered and may not be reported
|
|
60 |
* in any order.
|
|
61 |
*
|
|
62 |
* @return a readonly Iterator over Attribute interfaces, or an
|
|
63 |
* empty iterator
|
|
64 |
*/
|
|
65 |
public Iterator getAttributes();
|
|
66 |
|
|
67 |
/**
|
|
68 |
* Returns an Iterator of namespaces declared on this element.
|
|
69 |
* This Iterator does not contain previously declared namespaces
|
|
70 |
* unless they appear on the current START_ELEMENT.
|
|
71 |
* Therefore this list may contain redeclared namespaces and duplicate namespace
|
|
72 |
* declarations. Use the getNamespaceContext() method to get the
|
|
73 |
* current context of namespace declarations.
|
|
74 |
*
|
|
75 |
* <p>The iterator must contain only implementations of the
|
|
76 |
* javax.xml.stream.Namespace interface.
|
|
77 |
*
|
|
78 |
* <p>A Namespace isA Attribute. One
|
|
79 |
* can iterate over a list of namespaces as a list of attributes.
|
|
80 |
* However this method returns only the list of namespaces
|
|
81 |
* declared on this START_ELEMENT and does not
|
|
82 |
* include the attributes declared on this START_ELEMENT.
|
|
83 |
*
|
|
84 |
* Returns an empty iterator if there are no namespaces.
|
|
85 |
*
|
|
86 |
* @return a readonly Iterator over Namespace interfaces, or an
|
|
87 |
* empty iterator
|
|
88 |
*
|
|
89 |
*/
|
|
90 |
public Iterator getNamespaces();
|
|
91 |
|
|
92 |
/**
|
|
93 |
* Returns the attribute referred to by this name
|
|
94 |
* @param name the qname of the desired name
|
|
95 |
* @return the attribute corresponding to the name value or null
|
|
96 |
*/
|
|
97 |
public Attribute getAttributeByName(QName name);
|
|
98 |
|
|
99 |
/**
|
|
100 |
* Gets a read-only namespace context. If no context is
|
|
101 |
* available this method will return an empty namespace context.
|
|
102 |
* The NamespaceContext contains information about all namespaces
|
|
103 |
* in scope for this StartElement.
|
|
104 |
*
|
|
105 |
* @return the current namespace context
|
|
106 |
*/
|
|
107 |
public NamespaceContext getNamespaceContext();
|
|
108 |
|
|
109 |
/**
|
|
110 |
* Gets the value that the prefix is bound to in the
|
|
111 |
* context of this element. Returns null if
|
|
112 |
* the prefix is not bound in this context
|
|
113 |
* @param prefix the prefix to lookup
|
|
114 |
* @return the uri bound to the prefix or null
|
|
115 |
*/
|
|
116 |
public String getNamespaceURI(String prefix);
|
|
117 |
}
|