org.sonar.api.batch.sensor.duplication.internal
Class DefaultDuplicationBuilder

java.lang.Object
  extended by org.sonar.api.batch.sensor.duplication.internal.DefaultDuplicationBuilder
All Implemented Interfaces:
DuplicationBuilder

public class DefaultDuplicationBuilder
extends Object
implements DuplicationBuilder


Constructor Summary
DefaultDuplicationBuilder(InputFile inputFile)
           
 
Method Summary
 List<DuplicationGroup> build()
          Call this method when you have declared all duplications of the file.
 DuplicationBuilder isDuplicatedBy(InputFile sameOrOtherFile, int startLine, int endLine)
          Declare duplicate block of the previously declared DuplicationBuilder.originBlock(int, int).
 DuplicationBuilder isDuplicatedBy(String fileKey, int startLine, int endLine)
          For internal use.
 DuplicationBuilder originBlock(int startLine, int endLine)
          Declare duplication origin block.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDuplicationBuilder

public DefaultDuplicationBuilder(InputFile inputFile)
Method Detail

originBlock

public DuplicationBuilder originBlock(int startLine,
                                      int endLine)
Description copied from interface: DuplicationBuilder
Declare duplication origin block. Then call DuplicationBuilder.isDuplicatedBy(InputFile, int, int) to reference all duplicates of this block. Then call again DuplicationBuilder.originBlock(int, int) to declare another duplication.

Specified by:
originBlock in interface DuplicationBuilder

isDuplicatedBy

public DuplicationBuilder isDuplicatedBy(InputFile sameOrOtherFile,
                                         int startLine,
                                         int endLine)
Description copied from interface: DuplicationBuilder
Declare duplicate block of the previously declared DuplicationBuilder.originBlock(int, int).

Specified by:
isDuplicatedBy in interface DuplicationBuilder
Parameters:
sameOrOtherFile - duplicate can be in the same file or in another file.

isDuplicatedBy

public DuplicationBuilder isDuplicatedBy(String fileKey,
                                         int startLine,
                                         int endLine)
For internal use. Global duplications are referencing files outside of current project so no way to manipulate an InputFile.


build

public List<DuplicationGroup> build()
Description copied from interface: DuplicationBuilder
Call this method when you have declared all duplications of the file.

Specified by:
build in interface DuplicationBuilder


Copyright © 2009–2014 SonarSource. All rights reserved.