Skip to content
This repository has been archived by the owner on Jan 26, 2022. It is now read-only.

Commit

Permalink
Fixed json format for examples and syntaxes returning as array
Browse files Browse the repository at this point in the history
  • Loading branch information
Tuke-Nuke committed Aug 2, 2017
1 parent 612d57f commit ae28792
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 18 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
version=1.8.2-dev.1
version=1.8.2-dev.2
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ private void addSection(StringJoiner joiner, String section, List<SyntaxInfo> li
}
private void addSyntax(StringJoiner joiner, SyntaxInfo info) {
joiner.add("\t" + info.name + ":");
for (Map.Entry<String, Object> entry : info.toRawMap().entrySet())
for (Map.Entry<String, Object> entry : info.toMap().entrySet())
if (!entry.getKey().equals("Name")) //We already have the name above
addEntry(joiner, entry.getKey(), entry.getValue());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -140,21 +140,6 @@ public SyntaxInfo(JavaFunction info) {
}

public Map<String, Object> toMap() {
Map<String, Object> map = new LinkedHashMap<>();
addProperty(map, "Name", name);
addProperty(map, "Description", desc);
addProperty(map, "Examples", examples);
addProperty(map, "Usage", usage);
addProperty(map, "Since", since);
addProperty(map, "Return type", return_type);
addArray(map, "Changers", changers);
addProperty(map, "Patterns", patterns);
addArray(map, "Event values", event_values);
if (cancellable != null)
map.put("Cancellable", cancellable);
return map;
}
public Map<String, Object> toRawMap() {
Map<String, Object> map = new LinkedHashMap<>();
addProperty(map, "Name", name);
addArray(map, "Description", desc);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public void write(BufferedWriter writer, AddonInfo addon) throws IOException {

public void addSection(YamlConfiguration yaml, String section, List<SyntaxInfo> list) {
for (SyntaxInfo info : list)
for (Map.Entry<String, Object> entry : info.toRawMap().entrySet())
for (Map.Entry<String, Object> entry : info.toMap().entrySet())
if (!entry.getKey().equalsIgnoreCase("name")) {
Object obj = entry.getValue();
if (entry.getKey().equalsIgnoreCase("Patterns") && obj instanceof String)
Expand Down

0 comments on commit ae28792

Please sign in to comment.