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