01: /*
02: * Javolution - Java(TM) Solution for Real-Time and Embedded Systems
03: * Copyright (C) 2006 - Javolution (http://javolution.org/)
04: * All rights reserved.
05: *
06: * Permission to use, copy, modify, and distribute this software is
07: * freely granted, provided that this notice is preserved.
08: */
09: package javolution.xml.stream;
10:
11: import javolution.text.CharArray;
12: import j2me.lang.CharSequence;
13: import j2me.util.Iterator;
14:
15: /**
16: * This interface represents the XML namespace context stack while parsing.
17: *
18: * @author <a href="mailto:jean-marie@dautelle.com">Jean-Marie Dautelle</a>
19: * @version 4.0, September 12, 2006
20: */
21: public interface NamespaceContext {
22:
23: /**
24: * Returns the namespace URI bound to a prefix in the current scope
25: * or <code>null</code> if the prefix is unbound.
26: *
27: * @param prefix prefix to look up
28: * @return the namespace URI.
29: * @throws IllegalArgumentException if <code>prefix</code> is
30: * <code>null</code>
31: */
32: CharArray getNamespaceURI(CharSequence prefix);
33:
34: /**
35: * Returns the prefix bound to the namespace URI in the current scope
36: * or <code>null</code> if the namespace URI is unbound.
37: *
38: * @param namespaceURI URI of the namespace to lookup.
39: * @return the prefix bound to the namespace URI.
40: * @throws IllegalArgumentException if <code>namespaceURI</code> is
41: * <code>null</code>
42: */
43: CharArray getPrefix(CharSequence namespaceURI);
44:
45: /**
46: * Returns all prefixes bound to a namespace URI in the current scope
47: * (including predefined prefixes).
48: *
49: * @param namespaceURI URI of Namespace to lookup
50: * @return an <code>Iterator</code> over {@link CharArray} prefixes.
51: * @throws IllegalArgumentException if <code>namespaceURI</code> is
52: * <code>null</code>
53: */
54: Iterator getPrefixes(CharSequence namespaceURI);
55:
56: }
|