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