org.sonar.wsclient.services
Class SourceQuery

java.lang.Object
  extended by org.sonar.wsclient.services.AbstractQuery<M>
      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
           
 
Fields inherited from class org.sonar.wsclient.services.AbstractQuery
DEFAULT_TIMEOUT_MILLISECONDS
 
Constructor Summary
SourceQuery(String resourceKeyOrId)
           
 
Method Summary
static SourceQuery create(String resourceKeyOrId)
           
 int getFrom()
           
 Class<Source> getModelClass()
           
 String getResourceKeyOrId()
           
 int getTo()
           
 String getUrl()
          Must start with a slash, for example: /api/metrics
 SourceQuery setFromLineToLine(int from, int excludedTo)
          Get only a few lines
 SourceQuery setLinesFromLine(int from, int length)
           
 SourceQuery setResourceKeyOrId(String resourceKeyOrId)
           
 
Methods inherited from class org.sonar.wsclient.services.AbstractQuery
appendUrlParameter, appendUrlParameter, appendUrlParameter, appendUrlParameter, encode, getBody, getLocale, getTimeoutMilliseconds, setLocale, setTimeoutMilliseconds
 
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()

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)


Copyright © 2009–2015 SonarSource. All rights reserved.