1 package org.apache.maven.doxia.sink;
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 import java.util.LinkedList;
23 import java.util.List;
24
25
26
27
28
29
30
31
32
33 public class SinkEventTestingSink
34 extends AbstractSink
35 {
36
37 private final List<SinkEventElement> events = new LinkedList<SinkEventElement>();
38
39
40
41
42
43
44 public List<SinkEventElement> getEventList()
45 {
46 return this.events;
47 }
48
49
50 public void reset()
51 {
52 this.events.clear();
53 }
54
55
56
57
58
59
60 public void head()
61 {
62 addEvent( "head" );
63 }
64
65
66 public void head_()
67 {
68 addEvent( "head_" );
69 }
70
71
72 public void body()
73 {
74 addEvent( "body" );
75 }
76
77
78 public void body_()
79 {
80 addEvent( "body_" );
81 }
82
83
84 public void section1()
85 {
86 addEvent( "section1" );
87 }
88
89
90 public void section1_()
91 {
92 addEvent( "section1_" );
93 }
94
95
96 public void section2()
97 {
98 addEvent( "section2" );
99 }
100
101
102 public void section2_()
103 {
104 addEvent( "section2_" );
105 }
106
107
108 public void section3()
109 {
110 addEvent( "section3" );
111 }
112
113
114 public void section3_()
115 {
116 addEvent( "section3_" );
117 }
118
119
120 public void section4()
121 {
122 addEvent( "section4" );
123 }
124
125
126 public void section4_()
127 {
128 addEvent( "section4_" );
129 }
130
131
132 public void section5()
133 {
134 addEvent( "section5" );
135 }
136
137
138 public void section5_()
139 {
140 addEvent( "section5_" );
141 }
142
143
144 public void list()
145 {
146 addEvent( "list" );
147 }
148
149
150 public void list_()
151 {
152 addEvent( "list_" );
153 }
154
155
156 public void listItem()
157 {
158 addEvent( "listItem" );
159 }
160
161
162 public void listItem_()
163 {
164 addEvent( "listItem_" );
165 }
166
167
168 public void numberedList( int numbering )
169 {
170 addEvent( "numberedList", new Object[] {new Integer( numbering )} );
171 }
172
173
174 public void numberedList_()
175 {
176 addEvent( "numberedList_" );
177 }
178
179
180 public void numberedListItem()
181 {
182 addEvent( "numberedListItem" );
183 }
184
185
186 public void numberedListItem_()
187 {
188 addEvent( "numberedListItem_" );
189 }
190
191
192 public void definitionList()
193 {
194 addEvent( "definitionList" );
195 }
196
197
198 public void definitionList_()
199 {
200 addEvent( "definitionList_" );
201 }
202
203
204 public void definitionListItem()
205 {
206 addEvent( "definitionListItem" );
207 }
208
209
210 public void definitionListItem_()
211 {
212 addEvent( "definitionListItem_" );
213 }
214
215
216 public void definition()
217 {
218 addEvent( "definition" );
219 }
220
221
222 public void definition_()
223 {
224 addEvent( "definition_" );
225 }
226
227
228 public void figure()
229 {
230 addEvent( "figure" );
231 }
232
233
234 public void figure_()
235 {
236 addEvent( "figure_" );
237 }
238
239
240 public void table()
241 {
242 addEvent( "table" );
243 }
244
245
246 public void table_()
247 {
248 addEvent( "table_" );
249 }
250
251
252 public void tableRows( int[] justification, boolean grid )
253 {
254 addEvent( "tableRows", new Object[] {justification, new Boolean( grid )} );
255 }
256
257
258 public void tableRows_()
259 {
260 addEvent( "tableRows_" );
261 }
262
263
264 public void tableRow()
265 {
266 addEvent( "tableRow" );
267 }
268
269
270 public void tableRow_()
271 {
272 addEvent( "tableRow_" );
273 }
274
275
276 public void title()
277 {
278 addEvent( "title" );
279 }
280
281
282 public void title_()
283 {
284 addEvent( "title_" );
285 }
286
287
288 public void author()
289 {
290 addEvent( "author" );
291 }
292
293
294 public void author_()
295 {
296 addEvent( "author_" );
297 }
298
299
300 public void date()
301 {
302 addEvent( "date" );
303 }
304
305
306 public void date_()
307 {
308 addEvent( "date_" );
309 }
310
311
312 public void sectionTitle()
313 {
314 addEvent( "sectionTitle" );
315 }
316
317
318 public void sectionTitle_()
319 {
320 addEvent( "sectionTitle_" );
321 }
322
323
324 public void sectionTitle1()
325 {
326 addEvent( "sectionTitle1" );
327 }
328
329
330 public void sectionTitle1_()
331 {
332 addEvent( "sectionTitle1_" );
333 }
334
335
336 public void sectionTitle2()
337 {
338 addEvent( "sectionTitle2" );
339 }
340
341
342 public void sectionTitle2_()
343 {
344 addEvent( "sectionTitle2_" );
345 }
346
347
348 public void sectionTitle3()
349 {
350 addEvent( "sectionTitle3" );
351 }
352
353
354 public void sectionTitle3_()
355 {
356 addEvent( "sectionTitle3_" );
357 }
358
359
360 public void sectionTitle4()
361 {
362 addEvent( "sectionTitle4" );
363 }
364
365
366 public void sectionTitle4_()
367 {
368 addEvent( "sectionTitle4_" );
369 }
370
371
372 public void sectionTitle5()
373 {
374 addEvent( "sectionTitle5" );
375 }
376
377
378 public void sectionTitle5_()
379 {
380 addEvent( "sectionTitle5_" );
381 }
382
383
384 public void paragraph()
385 {
386 addEvent( "paragraph" );
387 }
388
389
390 public void paragraph_()
391 {
392 addEvent( "paragraph_" );
393 }
394
395
396 public void verbatim( boolean boxed )
397 {
398 addEvent( "verbatim", new Object[] {new Boolean( boxed )} );
399 }
400
401
402 public void verbatim_()
403 {
404 addEvent( "verbatim_" );
405 }
406
407
408 public void definedTerm()
409 {
410 addEvent( "definedTerm" );
411 }
412
413
414 public void definedTerm_()
415 {
416 addEvent( "definedTerm_" );
417 }
418
419
420 public void figureCaption()
421 {
422 addEvent( "figureCaption" );
423 }
424
425
426 public void figureCaption_()
427 {
428 addEvent( "figureCaption_" );
429 }
430
431
432 public void tableCell()
433 {
434 addEvent( "tableCell" );
435 }
436
437
438 public void tableCell( String width )
439 {
440 addEvent( "tableCell", new Object[] {width} );
441 }
442
443
444 public void tableCell_()
445 {
446 addEvent( "tableCell_" );
447 }
448
449
450 public void tableHeaderCell()
451 {
452 addEvent( "tableHeaderCell" );
453 }
454
455
456 public void tableHeaderCell( String width )
457 {
458 addEvent( "tableHeaderCell", new Object[] {width} );
459 }
460
461
462 public void tableHeaderCell_()
463 {
464 addEvent( "tableHeaderCell_" );
465 }
466
467
468 public void tableCaption()
469 {
470 addEvent( "tableCaption" );
471 }
472
473
474 public void tableCaption_()
475 {
476 addEvent( "tableCaption_" );
477 }
478
479
480 public void figureGraphics( String name )
481 {
482 addEvent( "figureGraphics", new Object[] {name} );
483 }
484
485
486 public void horizontalRule()
487 {
488 addEvent( "horizontalRule" );
489 }
490
491
492 public void pageBreak()
493 {
494 addEvent( "pageBreak" );
495 }
496
497
498 public void anchor( String name )
499 {
500 addEvent( "anchor", new Object[] {name} );
501 }
502
503
504 public void anchor_()
505 {
506 addEvent( "anchor_" );
507 }
508
509
510 public void link( String name )
511 {
512 addEvent( "link", new Object[] {name} );
513 }
514
515
516 public void link_()
517 {
518 addEvent( "link_" );
519 }
520
521
522 public void italic()
523 {
524 addEvent( "italic" );
525 }
526
527
528 public void italic_()
529 {
530 addEvent( "italic_" );
531 }
532
533
534 public void bold()
535 {
536 addEvent( "bold" );
537 }
538
539
540 public void bold_()
541 {
542 addEvent( "bold_" );
543 }
544
545
546 public void monospaced()
547 {
548 addEvent( "monospaced" );
549 }
550
551
552 public void monospaced_()
553 {
554 addEvent( "monospaced_" );
555 }
556
557
558 public void lineBreak()
559 {
560 addEvent( "lineBreak" );
561 }
562
563
564 public void nonBreakingSpace()
565 {
566 addEvent( "nonBreakingSpace" );
567 }
568
569
570 public void text( String text )
571 {
572 addEvent( "text", new Object[] {text} );
573 }
574
575
576 public void rawText( String text )
577 {
578 addEvent( "rawText", new Object[] {text} );
579 }
580
581
582 public void comment( String comment )
583 {
584 addEvent( "comment", new Object[] {comment} );
585 }
586
587
588 public void flush()
589 {
590 addEvent( "flush" );
591 }
592
593
594 public void close()
595 {
596 addEvent( "close" );
597 }
598
599
600 public void head( SinkEventAttributes attributes )
601 {
602 addEvent( "head", new Object[] {attributes} );
603 }
604
605
606 public void title( SinkEventAttributes attributes )
607 {
608 addEvent( "title", new Object[] {attributes} );
609 }
610
611
612 public void author( SinkEventAttributes attributes )
613 {
614 addEvent( "author", new Object[] {attributes} );
615 }
616
617
618 public void date( SinkEventAttributes attributes )
619 {
620 addEvent( "date", new Object[] {attributes} );
621 }
622
623
624 public void body( SinkEventAttributes attributes )
625 {
626 addEvent( "body", new Object[] {attributes} );
627 }
628
629
630 public void section( int level, SinkEventAttributes attributes )
631 {
632 addEvent( "section" + level, new Object[] {attributes} );
633 }
634
635
636 public void section_( int level )
637 {
638 addEvent( "section" + level + "_" );
639 }
640
641
642 public void sectionTitle( int level, SinkEventAttributes attributes )
643 {
644 addEvent( "sectionTitle" + level, new Object[] {attributes} );
645 }
646
647
648 public void sectionTitle_( int level )
649 {
650
651 addEvent( "sectionTitle" + level + "_" );
652 }
653
654
655 public void list( SinkEventAttributes attributes )
656 {
657 addEvent( "list", new Object[] {attributes} );
658 }
659
660
661 public void listItem( SinkEventAttributes attributes )
662 {
663 addEvent( "listItem", new Object[] {attributes} );
664 }
665
666
667 public void numberedList( int numbering, SinkEventAttributes attributes )
668 {
669 addEvent( "numberedList", new Object[] {new Integer( numbering ), attributes} );
670 }
671
672
673 public void numberedListItem( SinkEventAttributes attributes )
674 {
675 addEvent( "numberedListItem", new Object[] {attributes} );
676 }
677
678
679 public void definitionList( SinkEventAttributes attributes )
680 {
681 addEvent( "definitionList", new Object[] {attributes} );
682 }
683
684
685 public void definitionListItem( SinkEventAttributes attributes )
686 {
687 addEvent( "definitionListItem", new Object[] {attributes} );
688 }
689
690
691 public void definition( SinkEventAttributes attributes )
692 {
693 addEvent( "definition", new Object[] {attributes} );
694 }
695
696
697 public void definedTerm( SinkEventAttributes attributes )
698 {
699 addEvent( "definedTerm", new Object[] {attributes} );
700 }
701
702
703 public void figure( SinkEventAttributes attributes )
704 {
705 addEvent( "figure", new Object[] {attributes} );
706 }
707
708
709 public void figureCaption( SinkEventAttributes attributes )
710 {
711 addEvent( "figureCaption", new Object[] {attributes} );
712 }
713
714
715 public void figureGraphics( String src, SinkEventAttributes attributes )
716 {
717 addEvent( "figureGraphics", new Object[] {src, attributes} );
718 }
719
720
721 public void table( SinkEventAttributes attributes )
722 {
723 addEvent( "table", new Object[] {attributes} );
724 }
725
726
727 public void tableRow( SinkEventAttributes attributes )
728 {
729 addEvent( "tableRow", new Object[] {attributes} );
730 }
731
732
733 public void tableCell( SinkEventAttributes attributes )
734 {
735 addEvent( "tableCell", new Object[] {attributes} );
736 }
737
738
739 public void tableHeaderCell( SinkEventAttributes attributes )
740 {
741 addEvent( "tableHeaderCell", new Object[] {attributes} );
742 }
743
744
745 public void tableCaption( SinkEventAttributes attributes )
746 {
747 addEvent( "tableCaption", new Object[] {attributes} );
748 }
749
750
751 public void paragraph( SinkEventAttributes attributes )
752 {
753 addEvent( "paragraph", new Object[] {attributes} );
754 }
755
756
757 public void verbatim( SinkEventAttributes attributes )
758 {
759 addEvent( "verbatim", new Object[] {attributes} );
760 }
761
762
763 public void horizontalRule( SinkEventAttributes attributes )
764 {
765 addEvent( "horizontalRule", new Object[] {attributes} );
766 }
767
768
769 public void anchor( String name, SinkEventAttributes attributes )
770 {
771 addEvent( "anchor", new Object[] {name, attributes} );
772 }
773
774
775 public void link( String name, SinkEventAttributes attributes )
776 {
777 addEvent( "link", new Object[] {name, attributes} );
778 }
779
780
781 public void lineBreak( SinkEventAttributes attributes )
782 {
783 addEvent( "lineBreak", new Object[] {attributes} );
784 }
785
786
787 public void text( String text, SinkEventAttributes attributes )
788 {
789 addEvent( "text", new Object[] {text, attributes} );
790 }
791
792
793 public void unknown( String name, Object[] requiredParams, SinkEventAttributes attributes )
794 {
795 addEvent( "unknown", new Object[] {name, requiredParams, attributes} );
796 }
797
798
799
800
801
802
803
804
805
806
807 private void addEvent( String string )
808 {
809 addEvent( string, null );
810 }
811
812
813
814
815
816
817
818 private void addEvent( String string, Object[] arguments )
819 {
820 events.add( new SinkEventElement( string, arguments ) );
821 }
822
823 }