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.token;
22
23 import org.millscript.commons.alert.Alert;
24 import org.millscript.commons.alert.AlertDecorator;
25 import org.millscript.commons.xml.api.token.NotationDeclToken;
26 import org.millscript.commons.xml.api.token.TokenVisitor;
27
28 /**
29 * This class provides a default implementation of the notation declaration
30 * token.
31 */
32 public class NotationDeclTokenImpl implements AlertDecorator, NotationDeclToken {
33
34 /**
35 * The notation name.
36 */
37 private final String name;
38
39 /**
40 * The public identifier.
41 */
42 private final String publicIdentifier;
43
44 /**
45 * The system identifier.
46 */
47 private final String systemIdentifier;
48
49 /**
50 * Constructs a new notation declaration token with the specified notation
51 * name, public and system identifiers.
52 *
53 * @param n the notation name
54 * @param p the public identifier
55 * @param s the system identifier
56 */
57 public NotationDeclTokenImpl( final String n, final String p, final String s ) {
58 this.name = n;
59 this.publicIdentifier = p;
60 this.systemIdentifier = s;
61 }
62
63 /**
64 * @see org.millscript.commons.alert.AlertDecorator#decorate(org.millscript.commons.alert.Alert)
65 */
66 public Alert decorate( final Alert alert ) {
67 return alert.culprit(
68 "notationdecl",
69 "<!NOTATION " + this.name + " ..."
70 );
71 }
72
73 /**
74 * @see org.millscript.commons.xml.api.token.NotationDeclToken#getName()
75 */
76 public String getName() {
77 return this.name;
78 }
79
80 /**
81 * @see org.millscript.commons.xml.api.token.NotationDeclToken#getPubidLiteral()
82 */
83 public String getPubidLiteral() {
84 return this.publicIdentifier;
85 }
86
87 /**
88 * @see org.millscript.commons.xml.api.token.NotationDeclToken#getSystemLiteral()
89 */
90 public String getSystemLiteral() {
91 return this.systemIdentifier;
92 }
93
94 /**
95 * @see org.millscript.commons.xml.api.token.Token#visit(org.millscript.commons.xml.api.token.TokenVisitor)
96 */
97 public void visit( final TokenVisitor tokenVisitor ) {
98 tokenVisitor.visit( this );
99 }
100
101 }