|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.sonar.api.batch.SonarIndex
public abstract class SonarIndex
Constructor Summary | |
---|---|
SonarIndex()
|
Method Summary | ||
---|---|---|
abstract Dependency |
addDependency(Dependency dependency)
|
|
abstract Event |
addEvent(Resource resource,
String name,
String description,
String category,
Date date)
|
|
abstract void |
addLink(ProjectLink link)
|
|
abstract Measure |
addMeasure(Resource resource,
Measure measure)
Warning: the resource is automatically indexed for backward-compatibility, but it should be explictly indexed before. |
|
abstract Resource |
addResource(Resource resource)
Deprecated. since 2.6. Use methods index() |
|
void |
addViolation(Violation violation)
|
|
abstract void |
addViolation(Violation violation,
boolean force)
|
|
abstract void |
deleteEvent(Event event)
|
|
abstract void |
deleteLink(String key)
|
|
abstract Collection<Resource> |
getChildren(Resource reference)
|
|
abstract Set<Dependency> |
getDependencies()
|
|
abstract List<Event> |
getEvents(Resource resource)
|
|
Collection<Dependency> |
getIncomingDependencies(Resource to)
|
|
abstract Measure |
getMeasure(Resource resource,
Metric metric)
|
|
abstract
|
getMeasures(Resource resource,
MeasuresFilter<M> filter)
|
|
Collection<Dependency> |
getOutgoingDependencies(Resource from)
|
|
abstract Resource |
getParent(Resource reference)
|
|
abstract Project |
getProject()
|
|
abstract
|
getResource(R reference)
Search for an indexed resource. |
|
Collection<Resource> |
getResources()
|
|
abstract String |
getSource(Resource resource)
|
|
List<Violation> |
getViolations(Resource resource)
Returns all the active (= non switched-off) violations found on the given resource. |
|
abstract List<Violation> |
getViolations(ViolationQuery violationQuery)
Returns the violations that match the ViolationQuery parameters. |
|
abstract boolean |
index(Resource resource)
Indexes a resource as a direct child of project. |
|
abstract boolean |
index(Resource resource,
Resource parentReference)
Indexes a resource. |
|
abstract boolean |
isExcluded(Resource reference)
Returns true if the referenced resource is excluded. |
|
abstract boolean |
isIndexed(Resource reference,
boolean acceptExcluded)
|
|
abstract void |
setSource(Resource reference,
String source)
Save the source code of a file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.sonar.graph.DirectedGraphAccessor |
---|
getEdge, getIncomingEdges, getOutgoingEdges, getVertices, hasEdge |
Constructor Detail |
---|
public SonarIndex()
Method Detail |
---|
public abstract boolean index(Resource resource)
public abstract boolean index(Resource resource, Resource parentReference)
resource
- the resource to index. Not nullableparentReference
- a reference to the indexed parent. If null, the resource is indexed as a direct child of project.
public abstract boolean isExcluded(Resource reference)
public abstract boolean isIndexed(Resource reference, boolean acceptExcluded)
public abstract <R extends Resource> R getResource(R reference)
reference
- the resource reference
public abstract Resource getParent(Resource reference)
public abstract Collection<Resource> getChildren(Resource reference)
public abstract void setSource(Resource reference, String source) throws DuplicatedSourceException
DuplicatedSourceException
- if the source has already been set on this resourcepublic abstract String getSource(Resource resource)
null
if not availablepublic abstract Project getProject()
public final Collection<Resource> getResources()
@Deprecated public abstract Resource addResource(Resource resource)
public abstract Measure getMeasure(Resource resource, Metric metric)
public abstract <M> M getMeasures(Resource resource, MeasuresFilter<M> filter)
public abstract List<Violation> getViolations(ViolationQuery violationQuery)
ViolationQuery
parameters.
violationQuery
- the request parameters specified as a ViolationQuery
public final List<Violation> getViolations(Resource resource)
getViolations(ViolationQuery)
called with ViolationQuery.create().forResource(resource).ignoreSwitchedOff(true)
as a parameter.
public abstract void addViolation(Violation violation, boolean force)
public final void addViolation(Violation violation)
public abstract Measure addMeasure(Resource resource, Measure measure)
public abstract Dependency addDependency(Dependency dependency)
public abstract Set<Dependency> getDependencies()
public abstract void addLink(ProjectLink link)
public abstract void deleteLink(String key)
public abstract List<Event> getEvents(Resource resource)
public abstract void deleteEvent(Event event)
public abstract Event addEvent(Resource resource, String name, String description, String category, Date date)
public final Collection<Dependency> getOutgoingDependencies(Resource from)
public final Collection<Dependency> getIncomingDependencies(Resource to)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |