01: package javax.xml.stream.events;
02:
03: import javax.xml.namespace.QName;
04: import javax.xml.namespace.NamespaceContext;
05:
06: import java.util.Map;
07: import java.util.Iterator;
08:
09: /**
10: * The StartElement interface provides access to information about
11: * start elements. A StartElement is reported for each Start Tag
12: * in the document.
13: *
14: * @version 1.0
15: * @author Copyright (c) 2003 by BEA Systems. All Rights Reserved.
16: */
17: public interface StartElement extends XMLEvent {
18:
19: /**
20: * Get the name of this event
21: * @return the qualified name of this event
22: */
23: public QName getName();
24:
25: /**
26: * Returns an Iterator of non-namespace declared attributes declared on
27: * this START_ELEMENT,
28: * returns an empty iterator if there are no attributes. The
29: * iterator must contain only implementations of the javax.xml.stream.Attribute
30: * interface. Attributes are fundamentally unordered and may not be reported
31: * in any order.
32: *
33: * @return a readonly Iterator over Attribute interfaces, or an
34: * empty iterator
35: */
36: public Iterator getAttributes();
37:
38: /**
39: * Returns an Iterator of namespaces declared on this element.
40: * This Iterator does not contain previously declared namespaces
41: * unless they appear on the current START_ELEMENT.
42: * Therefore this list may contain redeclared namespaces and duplicate namespace
43: * declarations. Use the getNamespaceContext() method to get the
44: * current context of namespace declarations.
45: *
46: * <p>The iterator must contain only implementations of the
47: * javax.xml.stream.Namespace interface.
48: *
49: * <p>A Namespace isA Attribute. One
50: * can iterate over a list of namespaces as a list of attributes.
51: * However this method returns only the list of namespaces
52: * declared on this START_ELEMENT and does not
53: * include the attributes declared on this START_ELEMENT.
54: *
55: * Returns an empty iterator if there are no namespaces.
56: *
57: * @return a readonly Iterator over Namespace interfaces, or an
58: * empty iterator
59: *
60: */
61: public Iterator getNamespaces();
62:
63: /**
64: * Returns the attribute referred to by this name
65: * @param name the qname of the desired name
66: * @return the attribute corresponding to the name value or null
67: */
68: public Attribute getAttributeByName(QName name);
69:
70: /**
71: * Gets a read-only namespace context. If no context is
72: * available this method will return an empty namespace context.
73: * The NamespaceContext contains information about all namespaces
74: * in scope for this StartElement.
75: *
76: * @return the current namespace context
77: */
78: public NamespaceContext getNamespaceContext();
79:
80: /**
81: * Gets the value that the prefix is bound to in the
82: * context of this element. Returns null if
83: * the prefix is not bound in this context
84: * @param prefix the prefix to lookup
85: * @return the uri bound to the prefix or null
86: */
87: public String getNamespaceURI(String prefix);
88: }
|