本文整理汇总了Java中org.sonar.api.utils.text.JsonWriter.endArray方法的典型用法代码示例。如果您正苦于以下问题:Java JsonWriter.endArray方法的具体用法?Java JsonWriter.endArray怎么用?Java JsonWriter.endArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.sonar.api.utils.text.JsonWriter
的用法示例。
在下文中一共展示了JsonWriter.endArray方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: writeIssues
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
private void writeIssues(JsonWriter json) {
json.name("issues");
json.beginArray();
for (Issue issue : analyzerResult.issues()) {
json.beginObject();
json.prop("rule", issue.getRuleKey());
json.prop("severity", issue.getSeverity());
json.prop("message", issue.getMessage());
json.prop("type", issue.getType());
json.name("textRange")
.beginObject()
.prop("startLine", issue.getStartLine())
.prop("endLine", issue.getEndLine())
.prop("startOffset", issue.getStartLineOffset())
.prop("endOffset", issue.getEndLineOffset())
.endObject();
json.endObject();
}
json.endArray();
}
示例2: writeSymbolRefs
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
private void writeSymbolRefs(JsonWriter json) {
json.name("symbolRefs");
json.beginArray();
for (Map.Entry<TextRange, Set<TextRange>> entry : analyzerResult.symbolRefs().entrySet()) {
json.beginObject();
json.name("symbol").beginObject();
appendRange(json, entry.getKey());
json.endObject();
json.name("locations").beginArray();
for (TextRange range : entry.getValue()) {
json.beginObject();
appendRange(json, range);
json.endObject();
}
json.endArray();
json.endObject();
}
json.endArray();
}
示例3: write
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
public void write(final JsonWriter writer) {
writer.beginObject();
writer.prop("preview", preview);
writer.prop("issues", issues);
writer.prop("duplicateKeys", duplicateKeys);
writer.prop("matchedIssues", matchedIssues);
writer.name("matchFailures");
writer.beginArray();
writer.values(matchFailures);
writer.endArray();
writer.prop("transitionedIssues", transitionedIssues);
writer.name("transitionFailures");
writer.beginArray();
writer.values(transitionFailures);
writer.endArray();
writer.prop("assignedIssues", assignedIssues);
writer.name("assignFailures");
writer.beginArray();
writer.values(assignFailures);
writer.endArray();
writer.prop("commentedIssues", commentedIssues);
writer.name("commentFailures");
writer.beginArray();
writer.values(commentFailures);
writer.endArray();
writer.endObject();
}
示例4: write
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
/**
* Write data to export data.
*
* @param writer
* json writer
*/
public void write(final JsonWriter writer) {
writer.prop(NAME_STATUS, status);
writer.prop(NAME_RESOLUTION, resolution);
writer.prop(NAME_ASSIGNEE, assignee);
writer.name(NAME_COMMENTS);
writer.beginArray();
writer.values(comments);
writer.endArray();
}
示例5: writeHighlightings
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
private void writeHighlightings(JsonWriter json) {
json.name("highlightings");
json.beginArray();
for (Highlighting highlighting : analyzerResult.highlightings()) {
json.beginObject()
.prop("type", highlighting.type().name())
.prop("cssClass", highlighting.type().cssClass());
appendRange(json, highlighting.textRange());
json.endObject();
}
json.endArray();
}
示例6: writeErrors
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
private void writeErrors(JsonWriter json) {
json.name("errors");
json.beginArray();
analyzerResult.errors().stream().map(analysisErrorTranslator::translate).forEach(error -> {
TextPointer location = error.location();
json
.beginObject().prop("message", error.message())
.prop("line", location.line())
.prop("lineOffset", location.lineOffset())
.endObject();
});
json.endArray();
}
示例7: writeMavenDependencies
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
private static void writeMavenDependencies(JsonWriter json, List<MavenDependency> mavenDependencies)
{
json.name(MavenDependencyConfiguration.JSON_ARRAY_NAME).beginArray();
for (MavenDependency mavenDependency : mavenDependencies)
{
writeMavenDependency(json, mavenDependency);
}
json.endArray();
}
示例8: writeMavenLicenses
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
private static void writeMavenLicenses(JsonWriter json, List<MavenLicense> mavenLicenses)
{
json.name(MavenLicenseConfiguration.JSON_ARRAY_NAME).beginArray();
for (MavenLicense mavenLicense : mavenLicenses)
{
writeMavenLicense(json, mavenLicense);
}
json.endArray();
}
示例9: writeEnd
import org.sonar.api.utils.text.JsonWriter; //导入方法依赖的package包/类
private void writeEnd(final JsonWriter writer) {
writer.endArray();
writer.endObject();
writer.close();
}