org.sonar.api.batch.sensor.duplication
Interface DuplicationTokenBuilder


public interface DuplicationTokenBuilder

This builder is used to define token on files. Tokens are later used to compute duplication. Tokens should be declared in sequential order. Example:

 DuplicationTokenBuilder tokenBuilder = context.duplicationTokenBuilder(inputFile)
  .addToken(1, "public")
  .addToken(1, "class")
  .addToken(1, "Foo")
  .addToken(1, "{")
  .addToken(2, "}")
  .done();
 

Since:
4.5

Method Summary
 DuplicationTokenBuilder addToken(int line, String image)
          Call this method to register a new token.
 void done()
          Call this method only once when your are done with defining tokens of the file.
 

Method Detail

addToken

DuplicationTokenBuilder addToken(int line,
                                 String image)
Call this method to register a new token.

Parameters:
line - Line number of the token. Line starts at 1.
image - Text of the token.

done

void done()
Call this method only once when your are done with defining tokens of the file.



Copyright © 2009–2014 SonarSource. All rights reserved.