org.sonar.api.batch
Interface DecoratorContext
- All Known Implementing Classes:
- DefaultDecoratorContext
public interface DecoratorContext
- Since:
- 1.10
getProject
Project getProject()
- Returns:
- the project in which the decorator is
getResource
Resource getResource()
- Returns:
- the resource that is currently decorated
getChildren
List<DecoratorContext> getChildren()
- Child contexts are read only
getMeasure
Measure getMeasure(Metric metric)
- Find a measure for the resource
getMeasures
<M> M getMeasures(MeasuresFilter<M> filter)
- Never return null.
getChildrenMeasures
Collection<Measure> getChildrenMeasures(MeasuresFilter filter)
- Never return null.
getChildrenMeasures
Collection<Measure> getChildrenMeasures(Metric metric)
- Returns:
- the resource children measures for the given metric
saveMeasure
DecoratorContext saveMeasure(Measure measure)
- Add a measure on the current resource. It can not be executed from children contexts.
- Returns:
- the same context
saveMeasure
DecoratorContext saveMeasure(Metric metric,
Double value)
- Add a measure on the current resource. It can not be executed from children contexts.
- Returns:
- the current object
saveDependency
Dependency saveDependency(Dependency dependency)
getDependencies
Set<Dependency> getDependencies()
getIncomingDependencies
Collection<Dependency> getIncomingDependencies()
getOutgoingDependencies
Collection<Dependency> getOutgoingDependencies()
getViolations
List<Violation> getViolations()
- Read-only rule failures.
- Returns:
- the rule failures for file/classes resources, null for the others
saveViolation
DecoratorContext saveViolation(Violation violation)
- Save a coding rule violation. The decorator which calls this method must implement org.sonar.api.batch.GeneratesViolations
getEvents
List<Event> getEvents()
- Returns:
- the list of events associated to the current resource
createEvent
Event createEvent(String name,
String description,
String category,
Date date)
- Creates an event for a given date
- Parameters:
name - the event namedescription - the event descriptioncategory - the event categorydate - the event date
- Returns:
- the created event
deleteEvent
void deleteEvent(Event event)
- Deletes an event
- Parameters:
event - the event to delete
Copyright © 2009-2010 SonarSource SA. All Rights Reserved.