public class DefaultDecoratorContext extends Object implements DecoratorContext
| Constructor and Description |
|---|
DefaultDecoratorContext(Resource resource,
SonarIndex index,
List<DecoratorContext> childrenContexts) |
| Modifier and Type | Method and Description |
|---|---|
Event |
createEvent(String name,
String description,
String category,
Date date)
Creates an event for a given date
|
void |
deleteEvent(Event event)
Deletes an event
|
List<DecoratorContext> |
getChildren()
Child contexts are read only
|
Collection<Measure> |
getChildrenMeasures(MeasuresFilter filter)
Never return null.
|
Collection<Measure> |
getChildrenMeasures(Metric metric) |
Set<Dependency> |
getDependencies() |
List<Event> |
getEvents() |
Collection<Dependency> |
getIncomingDependencies() |
Measure |
getMeasure(Metric metric)
Find a measure for the resource
|
<M> M |
getMeasures(MeasuresFilter<M> filter)
Never return null.
|
Collection<Dependency> |
getOutgoingDependencies() |
Project |
getProject() |
Resource |
getResource() |
List<Violation> |
getViolations()
Returns all the active (= non switched-off) violations found on the current resource.
|
List<Violation> |
getViolations(ViolationQuery violationQuery)
Returns the violations that match the
ViolationQuery parameters. |
Dependency |
saveDependency(Dependency dependency) |
DecoratorContext |
saveMeasure(Measure measure)
Add a measure on the current resource.
|
DecoratorContext |
saveMeasure(Metric metric,
Double value)
Add a measure on the current resource.
|
DefaultDecoratorContext |
saveViolation(Violation violation)
Save a coding rule violation.
|
DefaultDecoratorContext |
saveViolation(Violation violation,
boolean force)
Save a coding rule violation.
|
DefaultDecoratorContext |
setReadOnly(boolean b) |
public DefaultDecoratorContext(Resource resource, SonarIndex index, List<DecoratorContext> childrenContexts)
public DefaultDecoratorContext setReadOnly(boolean b)
public Project getProject()
getProject in interface DecoratorContextpublic List<DecoratorContext> getChildren()
DecoratorContextgetChildren in interface DecoratorContextpublic <M> M getMeasures(MeasuresFilter<M> filter)
DecoratorContextgetMeasures in interface DecoratorContextpublic Measure getMeasure(Metric metric)
DecoratorContextgetMeasure in interface DecoratorContextpublic Collection<Measure> getChildrenMeasures(MeasuresFilter filter)
DecoratorContextgetChildrenMeasures in interface DecoratorContextpublic Collection<Measure> getChildrenMeasures(Metric metric)
getChildrenMeasures in interface DecoratorContextpublic Resource getResource()
getResource in interface DecoratorContextpublic DecoratorContext saveMeasure(Measure measure)
DecoratorContextsaveMeasure in interface DecoratorContextpublic DecoratorContext saveMeasure(Metric metric, Double value)
DecoratorContextsaveMeasure in interface DecoratorContextpublic List<Violation> getViolations(ViolationQuery violationQuery)
ViolationQuery parameters.getViolations in interface DecoratorContextviolationQuery - the request parameters specified as a ViolationQuerypublic List<Violation> getViolations()
getViolations in interface DecoratorContextpublic Dependency saveDependency(Dependency dependency)
saveDependency in interface DecoratorContextpublic Set<Dependency> getDependencies()
getDependencies in interface DecoratorContextpublic Collection<Dependency> getIncomingDependencies()
getIncomingDependencies in interface DecoratorContextpublic Collection<Dependency> getOutgoingDependencies()
getOutgoingDependencies in interface DecoratorContextpublic List<Event> getEvents()
getEvents in interface DecoratorContextpublic Event createEvent(String name, String description, String category, Date date)
DecoratorContextcreateEvent in interface DecoratorContextname - the event namedescription - the event descriptioncategory - the event categorydate - the event datepublic void deleteEvent(Event event)
DecoratorContextdeleteEvent in interface DecoratorContextevent - the event to deletepublic DefaultDecoratorContext saveViolation(Violation violation, boolean force)
DecoratorContextsaveViolation in interface DecoratorContextforce - allows to force creation of violation even if it was suppressed by ViolationFilterpublic DefaultDecoratorContext saveViolation(Violation violation)
DecoratorContextsaveViolation in interface DecoratorContextCopyright © 2009-2012 SonarSource. All Rights Reserved.