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
35
36 package oqube.muse;
37
38 import java.util.Collection;
39 import java.util.List;
40
41 /***
42 * This interface abstracts formatting events for parsing muse files. This
43 * interface is modelled after the Sink interface in doxia. This should allow
44 * easy wrapping of one by the other.
45 *
46 * @author abailly@oqube.muse.com
47 * @version $Id$
48 */
49 public interface MuseSink {
50
51
52
53
54 String ROLE = MuseSink.class.getName();
55
56 void setLineWidth(int lw);
57
58 void startDocument();
59
60 void endDocument();
61
62 void startHeader();
63
64 void endHeader();
65
66 void startBody();
67
68 void endBody();
69
70 void startFooter();
71
72 void endFooter();
73
74 void startPara();
75
76 void text(String txt);
77
78 void rawText(String text);
79
80 void endPara();
81
82 void startList();
83
84 void endList();
85
86 void startItem();
87
88 void endItem();
89
90 void startQuote();
91
92 void endQuote();
93
94 void startCenter();
95
96 void endCenter();
97
98 void startEnums();
99
100 void endEnums();
101
102 void startTitle1();
103
104 void endTitle1();
105
106 void startTitle2();
107
108 void endTitle2();
109
110 void startTitle3();
111
112 void endTitle3();
113
114 void startTitle4();
115
116 void endTitle4();
117
118 void startEmph();
119
120 void endEmph();
121
122 void startStrong();
123
124 void endStrong();
125
126 void startVerb();
127
128 void endVerb();
129
130 void startUline();
131
132 void endUline();
133
134 /***
135 * Generic formatting method for arbitrary tags denoting block level elements.
136 * This method is called when parser encounter XML-style tags used in muse
137 * that should be rendered as block-level elements. For example, in HTML this
138 * kind of tag would be rendered by <code><div></code> tags with the tag
139 * name as class attribute. <br />
140 *
141 * The distinction between *block* and *flow* elements is enforced by the kind
142 * of parser they are parsed with.
143 *
144 * @param tag
145 * the tag name
146 * @param content
147 * raw text inside tag
148 */
149 void block(String tag, String content);
150
151 void flow(String tag, String content);
152
153 void link(String s, String t);
154
155 void anchor(String a);
156
157 void addMetadata(String s, String t);
158
159 void separator();
160
161 void startTable();
162
163 void endTable();
164
165 void startTableHeader();
166
167 void endTableHeader();
168
169 void startTableData();
170
171 void endTableData();
172
173 void startTableRow();
174
175 void endTableRow();
176 }