1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 package org.millscript.commons.xml.tokenizer;
22
23 /**
24 * This class provides a base for tokenizing XML names, depending on whether
25 * namespaces are supported by the application or not.
26 */
27 public abstract class NameTokenizer {
28
29 /**
30 * The tokenizer we can use to fetch tokens that make up the name.
31 */
32 final AbstractXmlTokenizerImpl xmlTokenizer;
33
34 /**
35 * Constructs a new name tokenizer to tokenize a name from the specified
36 * tokenizer.
37 *
38 * @param xt the tokenizer to tokenize a name from
39 */
40 public NameTokenizer( final AbstractXmlTokenizerImpl xt ) {
41 this.xmlTokenizer = xt;
42 }
43
44 /**
45 * Returns a name for an attribute, read from the underlying tokenizer.
46 * This method is provided for reading an attribute name and nothing else,
47 * as it only allows qualified names to have a namespace.
48 *
49 * @return a <code>ProtoName</code> for the attribute, read from the
50 * underlying tokenizer
51 */
52 public abstract AbstractName readAttributeName();
53
54 /**
55 * Returns a name for a tag, read from the underlying tokenizer. This
56 * method is provided for reading a tag name and nothing else, as it allows
57 * tag names to use the default namespace declaration.
58 *
59 * @return a <code>ProtoName</code> for the tag, read from the underlying
60 * tokenizer
61 */
62 public abstract AbstractName readTagName();
63
64 }