1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package org.jaxen;
35
36 import java.util.Iterator;
37
38 /***
39 * Interface for navigating around an arbitrary object model
40 * accessing certain parts by name for performance.
41 * <p>
42 * This interface must only be implemented by those models that
43 * can support this named access behavior.
44 *
45 * @author Stephen Colebourne
46 */
47 public interface NamedAccessNavigator extends Navigator {
48
49 /***
50 * Retrieve an <code>Iterator</code> that returns the <code>child</code>
51 * XPath axis where the names of the children match the supplied name
52 * and optional namespace.
53 * <p>
54 * This method must only return element nodes with the correct name.
55 * <p>
56 * If the namespaceURI is null, no namespace should be used.
57 * The prefix will never be null.
58 *
59 * @param contextNode the origin context node
60 * @param localName the local name of the children to return, always present
61 * @param namespacePrefix the prefix of the namespace of the children to return
62 * @param namespaceURI the namespace URI of the children to return
63 *
64 * @return an Iterator capable of traversing the named children, or null if none
65 *
66 * @throws UnsupportedAxisException if the child axis is
67 * not supported by this object model
68 */
69 Iterator getChildAxisIterator(
70 Object contextNode,
71 String localName, String namespacePrefix, String namespaceURI)
72 throws UnsupportedAxisException;
73
74 /***
75 * Retrieve an <code>Iterator</code> that returns the <code>attribute</code>
76 * XPath axis where the names of the attributes match the supplied name
77 * and optional namespace.
78 * <p>
79 * This method must only return attribute nodes with the correct name.
80 * <p>
81 * If the namespaceURI is null, no namespace should be used.
82 * The prefix will never be null.
83 *
84 * @param contextNode the origin context node
85 * @param localName the local name of the attributes to return, always present
86 * @param namespacePrefix the prefix of the namespace of the attributes to return
87 * @param namespaceURI the URI of the namespace of the attributes to return
88 *
89 * @return an Iterator capable of traversing the named attributes, or null if none
90 *
91 * @throws UnsupportedAxisException if the attribute axis is
92 * not supported by this object model
93 */
94 Iterator getAttributeAxisIterator(
95 Object contextNode,
96 String localName, String namespacePrefix, String namespaceURI)
97 throws UnsupportedAxisException;
98
99 }