001package org.apache.maven.doxia.sink;
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
024/**
025 * Empty implementation of the <code>Sink</code> interface. Useful for testing purposes.
026 *
027 * @since 1.0
028 * @author <a href="mailto:jason@maven.org">Jason van Zyl</a>
029 * @author <a href="mailto:vincent.siveton@gmail.com">Vincent Siveton</a>
030 * @version $Id$
031 */
032public class SinkAdapter
033    extends AbstractSink
034{
035    /** {@inheritDoc} */
036    public void head()
037    {
038        // nop
039    }
040
041    /** {@inheritDoc} */
042    public void head_()
043    {
044        // nop
045    }
046
047    /** {@inheritDoc} */
048    public void body()
049    {
050        // nop
051    }
052
053    /** {@inheritDoc} */
054    public void body_()
055    {
056        // nop
057    }
058
059    /** {@inheritDoc} */
060    public void section1()
061    {
062        // nop
063    }
064
065    /** {@inheritDoc} */
066    public void section1_()
067    {
068        // nop
069    }
070
071    /** {@inheritDoc} */
072    public void section2()
073    {
074        // nop
075    }
076
077    /** {@inheritDoc} */
078    public void section2_()
079    {
080        // nop
081    }
082
083    /** {@inheritDoc} */
084    public void section3()
085    {
086        // nop
087    }
088
089    /** {@inheritDoc} */
090    public void section3_()
091    {
092        // nop
093    }
094
095    /** {@inheritDoc} */
096    public void section4()
097    {
098        // nop
099    }
100
101    /** {@inheritDoc} */
102    public void section4_()
103    {
104        // nop
105    }
106
107    /** {@inheritDoc} */
108    public void section5()
109    {
110        // nop
111    }
112
113    /** {@inheritDoc} */
114    public void section5_()
115    {
116        // nop
117    }
118
119    /** {@inheritDoc} */
120    public void list()
121    {
122        // nop
123    }
124
125    /** {@inheritDoc} */
126    public void list_()
127    {
128        // nop
129    }
130
131    /** {@inheritDoc} */
132    public void listItem()
133    {
134        // nop
135    }
136
137    /** {@inheritDoc} */
138    public void listItem_()
139    {
140        // nop
141    }
142
143    /** {@inheritDoc} */
144    public void numberedList( int numbering )
145    {
146        // nop
147    }
148
149    /** {@inheritDoc} */
150    public void numberedList_()
151    {
152        // nop
153    }
154
155    /** {@inheritDoc} */
156    public void numberedListItem()
157    {
158        // nop
159    }
160
161    /** {@inheritDoc} */
162    public void numberedListItem_()
163    {
164        // nop
165    }
166
167    /** {@inheritDoc} */
168    public void definitionList()
169    {
170        // nop
171    }
172
173    /** {@inheritDoc} */
174    public void definitionList_()
175    {
176        // nop
177    }
178
179    /** {@inheritDoc} */
180    public void definitionListItem()
181    {
182        // nop
183    }
184
185    /** {@inheritDoc} */
186    public void definitionListItem_()
187    {
188        // nop
189    }
190
191    /** {@inheritDoc} */
192    public void definition()
193    {
194        // nop
195    }
196
197    /** {@inheritDoc} */
198    public void definition_()
199    {
200        // nop
201    }
202
203    /** {@inheritDoc} */
204    public void figure()
205    {
206        // nop
207    }
208
209    /** {@inheritDoc} */
210    public void figure_()
211    {
212        // nop
213    }
214
215    /** {@inheritDoc} */
216    public void table()
217    {
218        // nop
219    }
220
221    /** {@inheritDoc} */
222    public void table_()
223    {
224        // nop
225    }
226
227    /** {@inheritDoc} */
228    public void tableRows( int[] justification, boolean grid )
229    {
230        // nop
231    }
232
233    /** {@inheritDoc} */
234    public void tableRows_()
235    {
236        // nop
237    }
238
239    /** {@inheritDoc} */
240    public void tableRow()
241    {
242        // nop
243    }
244
245    /** {@inheritDoc} */
246    public void tableRow_()
247    {
248        // nop
249    }
250
251    /** {@inheritDoc} */
252    public void title()
253    {
254        // nop
255    }
256
257    /** {@inheritDoc} */
258    public void title_()
259    {
260        // nop
261    }
262
263    /** {@inheritDoc} */
264    public void author()
265    {
266        // nop
267    }
268
269    /** {@inheritDoc} */
270    public void author_()
271    {
272        // nop
273    }
274
275    /** {@inheritDoc} */
276    public void date()
277    {
278        // nop
279    }
280
281    /** {@inheritDoc} */
282    public void date_()
283    {
284        // nop
285    }
286
287    /** {@inheritDoc} */
288    public void sectionTitle()
289    {
290        // nop
291    }
292
293    /** {@inheritDoc} */
294    public void sectionTitle_()
295    {
296        // nop
297    }
298
299    /** {@inheritDoc} */
300    public void sectionTitle1()
301    {
302        // nop
303    }
304
305    /** {@inheritDoc} */
306    public void sectionTitle1_()
307    {
308        // nop
309    }
310
311    /** {@inheritDoc} */
312    public void sectionTitle2()
313    {
314        // nop
315    }
316
317    /** {@inheritDoc} */
318    public void sectionTitle2_()
319    {
320        // nop
321    }
322
323    /** {@inheritDoc} */
324    public void sectionTitle3()
325    {
326        // nop
327    }
328
329    /** {@inheritDoc} */
330    public void sectionTitle3_()
331    {
332        // nop
333    }
334
335    /** {@inheritDoc} */
336    public void sectionTitle4()
337    {
338        // nop
339    }
340
341    /** {@inheritDoc} */
342    public void sectionTitle4_()
343    {
344        // nop
345    }
346
347    /** {@inheritDoc} */
348    public void sectionTitle5()
349    {
350        // nop
351    }
352
353    /** {@inheritDoc} */
354    public void sectionTitle5_()
355    {
356        // nop
357    }
358
359    /** {@inheritDoc} */
360    public void paragraph()
361    {
362        // nop
363    }
364
365    /** {@inheritDoc} */
366    public void paragraph_()
367    {
368        // nop
369    }
370
371    /** {@inheritDoc} */
372    public void verbatim( boolean boxed )
373    {
374        // nop
375    }
376
377    /** {@inheritDoc} */
378    public void verbatim_()
379    {
380        // nop
381    }
382
383    /** {@inheritDoc} */
384    public void definedTerm()
385    {
386        // nop
387    }
388
389    /** {@inheritDoc} */
390    public void definedTerm_()
391    {
392        // nop
393    }
394
395    /** {@inheritDoc} */
396    public void figureCaption()
397    {
398        // nop
399    }
400
401    /** {@inheritDoc} */
402    public void figureCaption_()
403    {
404        // nop
405    }
406
407    /** {@inheritDoc} */
408    public void tableCell()
409    {
410        // nop
411    }
412
413    /** {@inheritDoc} */
414    public void tableCell( String width )
415    {
416        // nop
417    }
418
419    /** {@inheritDoc} */
420    public void tableCell_()
421    {
422        // nop
423    }
424
425    /** {@inheritDoc} */
426    public void tableHeaderCell()
427    {
428        // nop
429    }
430
431    /** {@inheritDoc} */
432    public void tableHeaderCell( String width )
433    {
434        // nop
435    }
436
437    /** {@inheritDoc} */
438    public void tableHeaderCell_()
439    {
440        // nop
441    }
442
443    /** {@inheritDoc} */
444    public void tableCaption()
445    {
446        // nop
447    }
448
449    /** {@inheritDoc} */
450    public void tableCaption_()
451    {
452        // nop
453    }
454
455    /** {@inheritDoc} */
456    public void figureGraphics( String name )
457    {
458        // nop
459    }
460
461    /** {@inheritDoc} */
462    public void horizontalRule()
463    {
464        // nop
465    }
466
467    /** {@inheritDoc} */
468    public void pageBreak()
469    {
470        // nop
471    }
472
473    /** {@inheritDoc} */
474    public void anchor( String name )
475    {
476        // nop
477    }
478
479    /** {@inheritDoc} */
480    public void anchor_()
481    {
482        // nop
483    }
484
485    /** {@inheritDoc} */
486    public void link( String name )
487    {
488        // nop
489    }
490
491    /** {@inheritDoc} */
492    public void link_()
493    {
494        // nop
495    }
496
497    /** {@inheritDoc} */
498    public void italic()
499    {
500        // nop
501    }
502
503    /** {@inheritDoc} */
504    public void italic_()
505    {
506        // nop
507    }
508
509    /** {@inheritDoc} */
510    public void bold()
511    {
512        // nop
513    }
514
515    /** {@inheritDoc} */
516    public void bold_()
517    {
518        // nop
519    }
520
521    /** {@inheritDoc} */
522    public void monospaced()
523    {
524        // nop
525    }
526
527    /** {@inheritDoc} */
528    public void monospaced_()
529    {
530        // nop
531    }
532
533    /** {@inheritDoc} */
534    public void lineBreak()
535    {
536        // nop
537    }
538
539    /** {@inheritDoc} */
540    public void nonBreakingSpace()
541    {
542        // nop
543    }
544
545    /** {@inheritDoc} */
546    public void text( String text )
547    {
548        // nop
549    }
550
551    /** {@inheritDoc} */
552    public void rawText( String text )
553    {
554        // nop
555    }
556
557    /** {@inheritDoc} */
558    public void comment( String comment )
559    {
560        // nop
561    }
562
563    /** {@inheritDoc} */
564    public void flush()
565    {
566        // nop
567    }
568
569    /** {@inheritDoc} */
570    public void close()
571    {
572        // nop
573    }
574    /** {@inheritDoc} */
575    public void head( SinkEventAttributes attributes )
576    {
577        head();
578    }
579
580    /** {@inheritDoc} */
581    public void title( SinkEventAttributes attributes )
582    {
583        title();
584    }
585
586    /** {@inheritDoc} */
587    public void author( SinkEventAttributes attributes )
588    {
589        author();
590    }
591
592    /** {@inheritDoc} */
593    public void date( SinkEventAttributes attributes )
594    {
595        date();
596    }
597
598    /** {@inheritDoc} */
599    public void body( SinkEventAttributes attributes )
600    {
601        body();
602    }
603
604    /** {@inheritDoc} */
605    public void section( int level, SinkEventAttributes attributes )
606    {
607        if ( level == SECTION_LEVEL_1 )
608        {
609            section1();
610        }
611        else if ( level == SECTION_LEVEL_2 )
612        {
613            section2();
614        }
615        else if ( level == SECTION_LEVEL_3 )
616        {
617            section3();
618        }
619        else if ( level == SECTION_LEVEL_4 )
620        {
621            section4();
622        }
623        else if ( level == SECTION_LEVEL_5 )
624        {
625            section5();
626        }
627    }
628
629    /** {@inheritDoc} */
630    public void section_( int level )
631    {
632        if ( level == SECTION_LEVEL_1 )
633        {
634            section1_();
635        }
636        else if ( level == SECTION_LEVEL_2 )
637        {
638            section2_();
639        }
640        else if ( level == SECTION_LEVEL_3 )
641        {
642            section3_();
643        }
644        else if ( level == SECTION_LEVEL_4 )
645        {
646            section4_();
647        }
648        else if ( level == SECTION_LEVEL_5 )
649        {
650            section5_();
651        }
652    }
653
654    /** {@inheritDoc} */
655    public void sectionTitle( int level, SinkEventAttributes attributes )
656    {
657        if ( level == SECTION_LEVEL_1 )
658        {
659            sectionTitle1();
660        }
661        else if ( level == SECTION_LEVEL_2 )
662        {
663            sectionTitle2();
664        }
665        else if ( level == SECTION_LEVEL_3 )
666        {
667            sectionTitle3();
668        }
669        else if ( level == SECTION_LEVEL_4 )
670        {
671            sectionTitle4();
672        }
673        else if ( level == SECTION_LEVEL_5 )
674        {
675            sectionTitle5();
676        }
677    }
678
679    /** {@inheritDoc} */
680    public void sectionTitle_( int level )
681    {
682        if ( level == SECTION_LEVEL_1 )
683        {
684            sectionTitle1_();
685        }
686        else if ( level == SECTION_LEVEL_2 )
687        {
688            sectionTitle2_();
689        }
690        else if ( level == SECTION_LEVEL_3 )
691        {
692            sectionTitle3_();
693        }
694        else if ( level == SECTION_LEVEL_4 )
695        {
696            sectionTitle4_();
697        }
698        else if ( level == SECTION_LEVEL_5 )
699        {
700            sectionTitle5_();
701        }
702    }
703
704    /** {@inheritDoc} */
705    public void list( SinkEventAttributes attributes )
706    {
707        list();
708    }
709
710    /** {@inheritDoc} */
711    public void listItem( SinkEventAttributes attributes )
712    {
713        listItem();
714    }
715
716    /** {@inheritDoc} */
717    public void numberedList( int numbering, SinkEventAttributes attributes )
718    {
719        numberedList( numbering );
720    }
721
722    /** {@inheritDoc} */
723    public void numberedListItem( SinkEventAttributes attributes )
724    {
725        numberedListItem();
726    }
727
728    /** {@inheritDoc} */
729    public void definitionList( SinkEventAttributes attributes )
730    {
731        definitionList();
732    }
733
734    /** {@inheritDoc} */
735    public void definitionListItem( SinkEventAttributes attributes )
736    {
737        definitionListItem();
738    }
739
740    /** {@inheritDoc} */
741    public void definition( SinkEventAttributes attributes )
742    {
743        definition();
744    }
745
746    /** {@inheritDoc} */
747    public void definedTerm( SinkEventAttributes attributes )
748    {
749        definedTerm();
750    }
751
752    /** {@inheritDoc} */
753    public void figure( SinkEventAttributes attributes )
754    {
755        figure();
756    }
757
758    /** {@inheritDoc} */
759    public void figureCaption( SinkEventAttributes attributes )
760    {
761        figureCaption();
762    }
763
764    /** {@inheritDoc} */
765    public void figureGraphics( String src, SinkEventAttributes attributes )
766    {
767        figureGraphics( src );
768    }
769
770    /** {@inheritDoc} */
771    public void table( SinkEventAttributes attributes )
772    {
773        table();
774    }
775
776    /** {@inheritDoc} */
777    public void tableRow( SinkEventAttributes attributes )
778    {
779        tableRow();
780    }
781
782    /** {@inheritDoc} */
783    public void tableCell( SinkEventAttributes attributes )
784    {
785        tableCell();
786    }
787
788    /** {@inheritDoc} */
789    public void tableHeaderCell( SinkEventAttributes attributes )
790    {
791        tableHeaderCell();
792    }
793
794    /** {@inheritDoc} */
795    public void tableCaption( SinkEventAttributes attributes )
796    {
797        tableCaption();
798    }
799
800    /** {@inheritDoc} */
801    public void paragraph( SinkEventAttributes attributes )
802    {
803        paragraph();
804    }
805
806    /** {@inheritDoc} */
807    public void verbatim( SinkEventAttributes attributes )
808    {
809        MutableAttributeSet atts = SinkUtils.filterAttributes( attributes, SinkUtils.SINK_VERBATIM_ATTRIBUTES );
810
811        boolean boxed = false;
812
813        if ( atts != null && atts.isDefined( SinkEventAttributes.DECORATION ) )
814        {
815            boxed = "boxed".equals( atts.getAttribute( SinkEventAttributes.DECORATION ).toString() );
816        }
817
818        verbatim( boxed );
819    }
820
821    /** {@inheritDoc} */
822    public void horizontalRule( SinkEventAttributes attributes )
823    {
824        horizontalRule();
825    }
826
827    /** {@inheritDoc} */
828    public void anchor( String name, SinkEventAttributes attributes )
829    {
830        anchor( name );
831    }
832
833    /** {@inheritDoc} */
834    public void link( String name, SinkEventAttributes attributes )
835    {
836        link( name );
837    }
838
839    /** {@inheritDoc} */
840    public void lineBreak( SinkEventAttributes attributes )
841    {
842        lineBreak();
843    }
844
845    /** {@inheritDoc} */
846    public void text( String text, SinkEventAttributes attributes )
847    {
848        text( text );
849    }
850
851    /** {@inheritDoc} */
852    public void unknown( String name, Object[] requiredParams, SinkEventAttributes attributes )
853    {
854        // nop
855    }
856}