001package org.apache.maven.doxia.sink.impl;
002
003/*
004 * Licensed to the Apache Software Foundation (ASF) under one
005 * or more contributor license agreements.  See the NOTICE file
006 * distributed with this work for additional information
007 * regarding copyright ownership.  The ASF licenses this file
008 * to you under the Apache License, Version 2.0 (the
009 * "License"); you may not use this file except in compliance
010 * with the License.  You may obtain a copy of the License at
011 *
012 *   http://www.apache.org/licenses/LICENSE-2.0
013 *
014 * Unless required by applicable law or agreed to in writing,
015 * software distributed under the License is distributed on an
016 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
017 * KIND, either express or implied.  See the License for the
018 * specific language governing permissions and limitations
019 * under the License.
020 */
021
022import javax.swing.text.MutableAttributeSet;
023
024import org.apache.maven.doxia.sink.SinkEventAttributes;
025
026/**
027 * Empty implementation of the <code>Sink</code> interface. Useful for testing purposes.
028 *
029 * @since 1.0
030 * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
031 * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
032 */
033public class SinkAdapter
034    extends AbstractSink
035{
036    /** {@inheritDoc} */
037    @Override
038    public void head()
039    {
040        // nop
041    }
042
043    /** {@inheritDoc} */
044    @Override
045    public void head_()
046    {
047        // nop
048    }
049
050    /** {@inheritDoc} */
051    @Override
052    public void body()
053    {
054        // nop
055    }
056
057    /** {@inheritDoc} */
058    @Override
059    public void body_()
060    {
061        // nop
062    }
063
064    /** {@inheritDoc} */
065    @Override
066    public void article()
067    {
068        // nop
069    }
070
071    /** {@inheritDoc} */
072    @Override
073    public void article_()
074    {
075        // nop
076    }
077
078    /** {@inheritDoc} */
079    @Override
080    public void navigation()
081    {
082        // nop
083    }
084
085    /** {@inheritDoc} */
086    @Override
087    public void navigation_()
088    {
089        // nop
090    }
091
092    /** {@inheritDoc} */
093    @Override
094    public void sidebar()
095    {
096        // nop
097    }
098
099    /** {@inheritDoc} */
100    @Override
101    public void sidebar_()
102    {
103        // nop
104    }
105
106    /** {@inheritDoc} */
107    @Override
108    public void section1()
109    {
110        // nop
111    }
112
113    /** {@inheritDoc} */
114    @Override
115    public void section1_()
116    {
117        // nop
118    }
119
120    /** {@inheritDoc} */
121    @Override
122    public void section2()
123    {
124        // nop
125    }
126
127    /** {@inheritDoc} */
128    @Override
129    public void section2_()
130    {
131        // nop
132    }
133
134    /** {@inheritDoc} */
135    @Override
136    public void section3()
137    {
138        // nop
139    }
140
141    /** {@inheritDoc} */
142    @Override
143    public void section3_()
144    {
145        // nop
146    }
147
148    /** {@inheritDoc} */
149    @Override
150    public void section4()
151    {
152        // nop
153    }
154
155    /** {@inheritDoc} */
156    @Override
157    public void section4_()
158    {
159        // nop
160    }
161
162    /** {@inheritDoc} */
163    @Override
164    public void section5()
165    {
166        // nop
167    }
168
169    /** {@inheritDoc} */
170    @Override
171    public void section5_()
172    {
173        // nop
174    }
175    
176    /** {@inheritDoc} */
177    @Override
178    public void section6()
179    {
180        // nop
181    }
182    
183    /** {@inheritDoc} */
184    @Override
185    public void section6_()
186    {
187        // nop
188    }
189
190    /** {@inheritDoc} */
191    @Override
192    public void list()
193    {
194        // nop
195    }
196
197    /** {@inheritDoc} */
198    @Override
199    public void list_()
200    {
201        // nop
202    }
203
204    /** {@inheritDoc} */
205    @Override
206    public void listItem()
207    {
208        // nop
209    }
210
211    /** {@inheritDoc} */
212    @Override
213    public void listItem_()
214    {
215        // nop
216    }
217
218    /** {@inheritDoc} */
219    @Override
220    public void numberedList( int numbering )
221    {
222        // nop
223    }
224
225    /** {@inheritDoc} */
226    @Override
227    public void numberedList_()
228    {
229        // nop
230    }
231
232    /** {@inheritDoc} */
233    @Override
234    public void numberedListItem()
235    {
236        // nop
237    }
238
239    /** {@inheritDoc} */
240    @Override
241    public void numberedListItem_()
242    {
243        // nop
244    }
245
246    /** {@inheritDoc} */
247    @Override
248    public void definitionList()
249    {
250        // nop
251    }
252
253    /** {@inheritDoc} */
254    @Override
255    public void definitionList_()
256    {
257        // nop
258    }
259
260    /** {@inheritDoc} */
261    @Override
262    public void definitionListItem()
263    {
264        // nop
265    }
266
267    /** {@inheritDoc} */
268    @Override
269    public void definitionListItem_()
270    {
271        // nop
272    }
273
274    /** {@inheritDoc} */
275    @Override
276    public void definition()
277    {
278        // nop
279    }
280
281    /** {@inheritDoc} */
282    @Override
283    public void definition_()
284    {
285        // nop
286    }
287
288    /** {@inheritDoc} */
289    @Override
290    public void figure()
291    {
292        // nop
293    }
294
295    /** {@inheritDoc} */
296    @Override
297    public void figure_()
298    {
299        // nop
300    }
301
302    /** {@inheritDoc} */
303    @Override
304    public void table()
305    {
306        // nop
307    }
308
309    /** {@inheritDoc} */
310    @Override
311    public void table_()
312    {
313        // nop
314    }
315
316    /** {@inheritDoc} */
317    @Override
318    public void tableRows( int[] justification, boolean grid )
319    {
320        // nop
321    }
322
323    /** {@inheritDoc} */
324    @Override
325    public void tableRows_()
326    {
327        // nop
328    }
329
330    /** {@inheritDoc} */
331    @Override
332    public void tableRow()
333    {
334        // nop
335    }
336
337    /** {@inheritDoc} */
338    @Override
339    public void tableRow_()
340    {
341        // nop
342    }
343
344    /** {@inheritDoc} */
345    @Override
346    public void title()
347    {
348        // nop
349    }
350
351    /** {@inheritDoc} */
352    @Override
353    public void title_()
354    {
355        // nop
356    }
357
358    /** {@inheritDoc} */
359    @Override
360    public void author()
361    {
362        // nop
363    }
364
365    /** {@inheritDoc} */
366    @Override
367    public void author_()
368    {
369        // nop
370    }
371
372    /** {@inheritDoc} */
373    @Override
374    public void date()
375    {
376        // nop
377    }
378
379    /** {@inheritDoc} */
380    @Override
381    public void date_()
382    {
383        // nop
384    }
385
386    /** {@inheritDoc} */
387    @Override
388    public void sectionTitle()
389    {
390        // nop
391    }
392
393    /** {@inheritDoc} */
394    @Override
395    public void sectionTitle_()
396    {
397        // nop
398    }
399
400    /** {@inheritDoc} */
401    @Override
402    public void sectionTitle1()
403    {
404        // nop
405    }
406
407    /** {@inheritDoc} */
408    @Override
409    public void sectionTitle1_()
410    {
411        // nop
412    }
413
414    /** {@inheritDoc} */
415    @Override
416    public void sectionTitle2()
417    {
418        // nop
419    }
420
421    /** {@inheritDoc} */
422    @Override
423    public void sectionTitle2_()
424    {
425        // nop
426    }
427
428    /** {@inheritDoc} */
429    @Override
430    public void sectionTitle3()
431    {
432        // nop
433    }
434
435    /** {@inheritDoc} */
436    @Override
437    public void sectionTitle3_()
438    {
439        // nop
440    }
441
442    /** {@inheritDoc} */
443    @Override
444    public void sectionTitle4()
445    {
446        // nop
447    }
448
449    /** {@inheritDoc} */
450    @Override
451    public void sectionTitle4_()
452    {
453        // nop
454    }
455
456    /** {@inheritDoc} */
457    @Override
458    public void sectionTitle5()
459    {
460        // nop
461    }
462
463    /** {@inheritDoc} */
464    @Override
465    public void sectionTitle5_()
466    {
467        // nop
468    }
469
470    /** {@inheritDoc} */
471    @Override
472    public void sectionTitle6()
473    {
474        // nop
475    }
476
477    /** {@inheritDoc} */
478    @Override
479    public void sectionTitle6_()
480    {
481        // nop
482    }
483
484    /** {@inheritDoc} */
485    @Override
486    public void header()
487    {
488        // nop
489    }
490
491    /** {@inheritDoc} */
492    @Override
493    public void header_()
494    {
495        // nop
496    }
497
498    /** {@inheritDoc} */
499    @Override
500    public void content()
501    {
502        // nop
503    }
504
505    /** {@inheritDoc} */
506    @Override
507    public void content_()
508    {
509        // nop
510    }
511
512    /** {@inheritDoc} */
513    @Override
514    public void footer()
515    {
516        // nop
517    }
518
519    /** {@inheritDoc} */
520    @Override
521    public void footer_()
522    {
523        // nop
524    }
525
526    /** {@inheritDoc} */
527    @Override
528    public void paragraph()
529    {
530        // nop
531    }
532
533    /** {@inheritDoc} */
534    @Override
535    public void paragraph_()
536    {
537        // nop
538    }
539
540    /** {@inheritDoc} */
541    @Override
542    public void data( String value )
543    {
544        // nop
545    }
546
547    /** {@inheritDoc} */
548    @Override
549    public void data_()
550    {
551        // nop
552    }
553
554    /** {@inheritDoc} */
555    @Override
556    public void time( String datetime )
557    {
558        // nop
559    }
560
561    /** {@inheritDoc} */
562    @Override
563    public void time_()
564    {
565        // nop
566    }
567
568    /** {@inheritDoc} */
569    @Override
570    public void address()
571    {
572        // nop
573    }
574
575    /** {@inheritDoc} */
576    @Override
577    public void address_()
578    {
579        // nop
580    }
581
582    /** {@inheritDoc} */
583    @Override
584    public void blockquote()
585    {
586        // nop
587    }
588
589    /** {@inheritDoc} */
590    @Override
591    public void blockquote_()
592    {
593        // nop
594    }
595
596    /** {@inheritDoc} */
597    @Override
598    public void division()
599    {
600        // nop
601    }
602
603    /** {@inheritDoc} */
604    @Override
605    public void division_()
606    {
607        // nop
608    }
609
610    /** {@inheritDoc} */
611    @Override
612    public void verbatim( boolean boxed )
613    {
614        // nop
615    }
616
617    /** {@inheritDoc} */
618    @Override
619    public void verbatim_()
620    {
621        // nop
622    }
623
624    /** {@inheritDoc} */
625    @Override
626    public void definedTerm()
627    {
628        // nop
629    }
630
631    /** {@inheritDoc} */
632    @Override
633    public void definedTerm_()
634    {
635        // nop
636    }
637
638    /** {@inheritDoc} */
639    @Override
640    public void figureCaption()
641    {
642        // nop
643    }
644
645    /** {@inheritDoc} */
646    @Override
647    public void figureCaption_()
648    {
649        // nop
650    }
651
652    /** {@inheritDoc} */
653    @Override
654    public void tableCell()
655    {
656        // nop
657    }
658
659    /** {@inheritDoc} */
660    @Override
661    public void tableCell( String width )
662    {
663        // nop
664    }
665
666    /** {@inheritDoc} */
667    @Override
668    public void tableCell_()
669    {
670        // nop
671    }
672
673    /** {@inheritDoc} */
674    @Override
675    public void tableHeaderCell()
676    {
677        // nop
678    }
679
680    /** {@inheritDoc} */
681    @Override
682    public void tableHeaderCell( String width )
683    {
684        // nop
685    }
686
687    /** {@inheritDoc} */
688    @Override
689    public void tableHeaderCell_()
690    {
691        // nop
692    }
693
694    /** {@inheritDoc} */
695    @Override
696    public void tableCaption()
697    {
698        // nop
699    }
700
701    /** {@inheritDoc} */
702    @Override
703    public void tableCaption_()
704    {
705        // nop
706    }
707
708    /** {@inheritDoc} */
709    @Override
710    public void figureGraphics( String name )
711    {
712        // nop
713    }
714
715    /** {@inheritDoc} */
716    @Override
717    public void horizontalRule()
718    {
719        // nop
720    }
721
722    /** {@inheritDoc} */
723    @Override
724    public void pageBreak()
725    {
726        // nop
727    }
728
729    /** {@inheritDoc} */
730    @Override
731    public void anchor( String name )
732    {
733        // nop
734    }
735
736    /** {@inheritDoc} */
737    @Override
738    public void anchor_()
739    {
740        // nop
741    }
742
743    /** {@inheritDoc} */
744    @Override
745    public void link( String name )
746    {
747        // nop
748    }
749
750    /** {@inheritDoc} */
751    @Override
752    public void link_()
753    {
754        // nop
755    }
756
757    /** {@inheritDoc} */
758    @Override
759    public void inline()
760    {
761        // nop
762    }
763
764    /** {@inheritDoc} */
765    @Override
766    public void inline_()
767    {
768        // nop
769    }
770
771    /** {@inheritDoc} */
772    @Override
773    public void italic()
774    {
775        // nop
776    }
777
778    /** {@inheritDoc} */
779    @Override
780    public void italic_()
781    {
782        // nop
783    }
784
785    /** {@inheritDoc} */
786    @Override
787    public void bold()
788    {
789        // nop
790    }
791
792    /** {@inheritDoc} */
793    @Override
794    public void bold_()
795    {
796        // nop
797    }
798
799    /** {@inheritDoc} */
800    @Override
801    public void monospaced()
802    {
803        // nop
804    }
805
806    /** {@inheritDoc} */
807    @Override
808    public void monospaced_()
809    {
810        // nop
811    }
812
813    /** {@inheritDoc} */
814    @Override
815    public void lineBreak()
816    {
817        // nop
818    }
819
820    /** {@inheritDoc} */
821    @Override
822    public void lineBreakOpportunity()
823    {
824        // nop
825    }
826
827    /** {@inheritDoc} */
828    @Override
829    public void nonBreakingSpace()
830    {
831        // nop
832    }
833
834    /** {@inheritDoc} */
835    @Override
836    public void text( String text )
837    {
838        // nop
839    }
840
841    /** {@inheritDoc} */
842    @Override
843    public void rawText( String text )
844    {
845        // nop
846    }
847
848    /** {@inheritDoc} */
849    @Override
850    public void comment( String comment )
851    {
852        // nop
853    }
854
855    /** {@inheritDoc} */
856    @Override
857    public void flush()
858    {
859        // nop
860    }
861
862    /** {@inheritDoc} */
863    @Override
864    public void close()
865    {
866        // nop
867    }
868    /** {@inheritDoc} */
869    @Override
870    public void head( SinkEventAttributes attributes )
871    {
872        head();
873    }
874
875    /** {@inheritDoc} */
876    @Override
877    public void title( SinkEventAttributes attributes )
878    {
879        title();
880    }
881
882    /** {@inheritDoc} */
883    @Override
884    public void author( SinkEventAttributes attributes )
885    {
886        author();
887    }
888
889    /** {@inheritDoc} */
890    @Override
891    public void date( SinkEventAttributes attributes )
892    {
893        date();
894    }
895
896    /** {@inheritDoc} */
897    @Override
898    public void body( SinkEventAttributes attributes )
899    {
900        body();
901    }
902
903    /** {@inheritDoc} */
904    @Override
905    public void article( SinkEventAttributes attributes )
906    {
907        article();
908    }
909
910    /** {@inheritDoc} */
911    @Override
912    public void navigation( SinkEventAttributes attributes )
913    {
914        navigation();
915    }
916
917    /** {@inheritDoc} */
918    @Override
919    public void sidebar( SinkEventAttributes attributes )
920    {
921        sidebar();
922    }
923
924    /** {@inheritDoc} */
925    @Override
926    public void section( int level, SinkEventAttributes attributes )
927    {
928        if ( level == SECTION_LEVEL_1 )
929        {
930            section1();
931        }
932        else if ( level == SECTION_LEVEL_2 )
933        {
934            section2();
935        }
936        else if ( level == SECTION_LEVEL_3 )
937        {
938            section3();
939        }
940        else if ( level == SECTION_LEVEL_4 )
941        {
942            section4();
943        }
944        else if ( level == SECTION_LEVEL_5 )
945        {
946            section5();
947        }
948    }
949
950    /** {@inheritDoc} */
951    @Override
952    public void section_( int level )
953    {
954        if ( level == SECTION_LEVEL_1 )
955        {
956            section1_();
957        }
958        else if ( level == SECTION_LEVEL_2 )
959        {
960            section2_();
961        }
962        else if ( level == SECTION_LEVEL_3 )
963        {
964            section3_();
965        }
966        else if ( level == SECTION_LEVEL_4 )
967        {
968            section4_();
969        }
970        else if ( level == SECTION_LEVEL_5 )
971        {
972            section5_();
973        }
974    }
975
976    /** {@inheritDoc} */
977    @Override
978    public void sectionTitle( int level, SinkEventAttributes attributes )
979    {
980        if ( level == SECTION_LEVEL_1 )
981        {
982            sectionTitle1();
983        }
984        else if ( level == SECTION_LEVEL_2 )
985        {
986            sectionTitle2();
987        }
988        else if ( level == SECTION_LEVEL_3 )
989        {
990            sectionTitle3();
991        }
992        else if ( level == SECTION_LEVEL_4 )
993        {
994            sectionTitle4();
995        }
996        else if ( level == SECTION_LEVEL_5 )
997        {
998            sectionTitle5();
999        }
1000    }
1001
1002    /** {@inheritDoc} */
1003    @Override
1004    public void sectionTitle_( int level )
1005    {
1006        if ( level == SECTION_LEVEL_1 )
1007        {
1008            sectionTitle1_();
1009        }
1010        else if ( level == SECTION_LEVEL_2 )
1011        {
1012            sectionTitle2_();
1013        }
1014        else if ( level == SECTION_LEVEL_3 )
1015        {
1016            sectionTitle3_();
1017        }
1018        else if ( level == SECTION_LEVEL_4 )
1019        {
1020            sectionTitle4_();
1021        }
1022        else if ( level == SECTION_LEVEL_5 )
1023        {
1024            sectionTitle5_();
1025        }
1026    }
1027
1028    /** {@inheritDoc} */
1029    @Override
1030    public void header( SinkEventAttributes attributes )
1031    {
1032        header();
1033    }
1034
1035    /** {@inheritDoc} */
1036    @Override
1037    public void content( SinkEventAttributes attributes )
1038    {
1039        content();
1040    }
1041
1042    /** {@inheritDoc} */
1043    @Override
1044    public void footer( SinkEventAttributes attributes )
1045    {
1046        footer();
1047    }
1048
1049    /** {@inheritDoc} */
1050    @Override
1051    public void list( SinkEventAttributes attributes )
1052    {
1053        list();
1054    }
1055
1056    /** {@inheritDoc} */
1057    @Override
1058    public void listItem( SinkEventAttributes attributes )
1059    {
1060        listItem();
1061    }
1062
1063    /** {@inheritDoc} */
1064    @Override
1065    public void numberedList( int numbering, SinkEventAttributes attributes )
1066    {
1067        numberedList( numbering );
1068    }
1069
1070    /** {@inheritDoc} */
1071    @Override
1072    public void numberedListItem( SinkEventAttributes attributes )
1073    {
1074        numberedListItem();
1075    }
1076
1077    /** {@inheritDoc} */
1078    @Override
1079    public void definitionList( SinkEventAttributes attributes )
1080    {
1081        definitionList();
1082    }
1083
1084    /** {@inheritDoc} */
1085    @Override
1086    public void definitionListItem( SinkEventAttributes attributes )
1087    {
1088        definitionListItem();
1089    }
1090
1091    /** {@inheritDoc} */
1092    @Override
1093    public void definition( SinkEventAttributes attributes )
1094    {
1095        definition();
1096    }
1097
1098    /** {@inheritDoc} */
1099    @Override
1100    public void definedTerm( SinkEventAttributes attributes )
1101    {
1102        definedTerm();
1103    }
1104
1105    /** {@inheritDoc} */
1106    @Override
1107    public void figure( SinkEventAttributes attributes )
1108    {
1109        figure();
1110    }
1111
1112    /** {@inheritDoc} */
1113    @Override
1114    public void figureCaption( SinkEventAttributes attributes )
1115    {
1116        figureCaption();
1117    }
1118
1119    /** {@inheritDoc} */
1120    @Override
1121    public void figureGraphics( String src, SinkEventAttributes attributes )
1122    {
1123        figureGraphics( src );
1124    }
1125
1126    /** {@inheritDoc} */
1127    @Override
1128    public void table( SinkEventAttributes attributes )
1129    {
1130        table();
1131    }
1132
1133    /** {@inheritDoc} */
1134    @Override
1135    public void tableRow( SinkEventAttributes attributes )
1136    {
1137        tableRow();
1138    }
1139
1140    /** {@inheritDoc} */
1141    @Override
1142    public void tableCell( SinkEventAttributes attributes )
1143    {
1144        tableCell();
1145    }
1146
1147    /** {@inheritDoc} */
1148    @Override
1149    public void tableHeaderCell( SinkEventAttributes attributes )
1150    {
1151        tableHeaderCell();
1152    }
1153
1154    /** {@inheritDoc} */
1155    @Override
1156    public void tableCaption( SinkEventAttributes attributes )
1157    {
1158        tableCaption();
1159    }
1160
1161    /** {@inheritDoc} */
1162    @Override
1163    public void paragraph( SinkEventAttributes attributes )
1164    {
1165        paragraph();
1166    }
1167
1168    /** {@inheritDoc} */
1169    @Override
1170    public void data( String value, SinkEventAttributes attributes )
1171    {
1172        data( value );
1173    }
1174
1175    /** {@inheritDoc} */
1176    @Override
1177    public void time( String datetime, SinkEventAttributes attributes )
1178    {
1179        time( datetime );
1180    }
1181
1182    /** {@inheritDoc} */
1183    @Override
1184    public void address( SinkEventAttributes attributes )
1185    {
1186        address();
1187    }
1188
1189    /** {@inheritDoc} */
1190    @Override
1191    public void blockquote( SinkEventAttributes attributes )
1192    {
1193        blockquote();
1194    }
1195
1196    /** {@inheritDoc} */
1197    @Override
1198    public void division( SinkEventAttributes attributes )
1199    {
1200        division();
1201    }
1202
1203    /** {@inheritDoc} */
1204    @Override
1205    public void verbatim( SinkEventAttributes attributes )
1206    {
1207        MutableAttributeSet atts = SinkUtils.filterAttributes( attributes, SinkUtils.SINK_VERBATIM_ATTRIBUTES );
1208
1209        boolean boxed = false;
1210
1211        if ( atts != null && atts.isDefined( SinkEventAttributes.DECORATION ) )
1212        {
1213            boxed = "boxed".equals( atts.getAttribute( SinkEventAttributes.DECORATION ).toString() );
1214        }
1215
1216        verbatim( boxed );
1217    }
1218
1219    /** {@inheritDoc} */
1220    @Override
1221    public void horizontalRule( SinkEventAttributes attributes )
1222    {
1223        horizontalRule();
1224    }
1225
1226    /** {@inheritDoc} */
1227    @Override
1228    public void anchor( String name, SinkEventAttributes attributes )
1229    {
1230        anchor( name );
1231    }
1232
1233    /** {@inheritDoc} */
1234    @Override
1235    public void link( String name, SinkEventAttributes attributes )
1236    {
1237        link( name );
1238    }
1239
1240    /** {@inheritDoc} */
1241    @Override
1242    public void inline( SinkEventAttributes attributes )
1243    {
1244        inline();
1245    }
1246
1247    /** {@inheritDoc} */
1248    @Override
1249    public void lineBreak( SinkEventAttributes attributes )
1250    {
1251        lineBreak();
1252    }
1253
1254    /** {@inheritDoc} */
1255    @Override
1256    public void lineBreakOpportunity( SinkEventAttributes attributes )
1257    {
1258        lineBreakOpportunity();
1259    }
1260
1261    /** {@inheritDoc} */
1262    @Override
1263    public void text( String text, SinkEventAttributes attributes )
1264    {
1265        text( text );
1266    }
1267
1268    /** {@inheritDoc} */
1269    @Override
1270    public void unknown( String name, Object[] requiredParams, SinkEventAttributes attributes )
1271    {
1272        // nop
1273    }
1274}