org.sonar.wsclient.services
Class SourceQuery

java.lang.Object
  extended by org.sonar.wsclient.services.AbstractQuery<MODEL>
      extended by org.sonar.wsclient.services.Query<Source>
          extended by org.sonar.wsclient.services.SourceQuery

public class SourceQuery
extends Query<Source>


Field Summary
static String BASE_URL
           
 
Constructor Summary
SourceQuery(String resourceKeyOrId)
           
 
Method Summary
static SourceQuery create(String resourceKeyOrId)
           
static SourceQuery createWithHighlightedSyntax(String resourceKeyOrId)
           
 int getFrom()
           
 Class<Source> getModelClass()
           
 String getResourceKeyOrId()
           
 int getTo()
           
 String getUrl()
          Must start with a slash, for example: /api/metrics
 boolean isHighlightedSyntax()
           
 SourceQuery setFromLineToLine(int from, int excludedTo)
          Get only a few lines
 SourceQuery setHighlightedSyntax(boolean b)
           
 SourceQuery setLinesFromLine(int from, int length)
           
 SourceQuery setResourceKeyOrId(String resourceKeyOrId)
           
 
Methods inherited from class org.sonar.wsclient.services.AbstractQuery
appendUrlParameter, appendUrlParameter, appendUrlParameter, encode, getBody
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASE_URL

public static final String BASE_URL
See Also:
Constant Field Values
Constructor Detail

SourceQuery

public SourceQuery(String resourceKeyOrId)
Method Detail

getResourceKeyOrId

public String getResourceKeyOrId()

setResourceKeyOrId

public SourceQuery setResourceKeyOrId(String resourceKeyOrId)

getFrom

public int getFrom()

setFromLineToLine

public SourceQuery setFromLineToLine(int from,
                                     int excludedTo)
Get only a few lines

Parameters:
from - Index of the first line, starts to 1
excludedTo - Index of the last line (excluded).

setLinesFromLine

public SourceQuery setLinesFromLine(int from,
                                    int length)

getTo

public int getTo()

isHighlightedSyntax

public boolean isHighlightedSyntax()

setHighlightedSyntax

public SourceQuery setHighlightedSyntax(boolean b)

getUrl

public String getUrl()
Description copied from class: AbstractQuery
Must start with a slash, for example: /api/metrics

IMPORTANT: In implementations of this method we must use helper methods to construct URL.

Specified by:
getUrl in class AbstractQuery<Source>
See Also:
AbstractQuery.encode(String), AbstractQuery.appendUrlParameter(StringBuilder, String, Object), AbstractQuery.appendUrlParameter(StringBuilder, String, Object[]), AbstractQuery.appendUrlParameter(StringBuilder, String, Date, boolean)

getModelClass

public Class<Source> getModelClass()
Specified by:
getModelClass in class Query<Source>

create

public static SourceQuery create(String resourceKeyOrId)

createWithHighlightedSyntax

public static SourceQuery createWithHighlightedSyntax(String resourceKeyOrId)


Copyright © 2009-2011 SonarSource. All Rights Reserved.