Skip to content

Commit

Permalink
Merge pull request xjtu-enre#57 from ba1man/main
Browse files Browse the repository at this point in the history
add 'location' property for Enum Constant entity in result
  • Loading branch information
Lynn-Dai authored Nov 9, 2023
2 parents 101063e + b58fbb0 commit e9d419b
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/main/java/entity/adapter/EntityDTOAdapter.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ protected void write(JsonWriter out, EnumEntityDTO value) throws IOException {
protected void write(JsonWriter out, EnumConstantEntityDTO value) throws IOException {
writeFile(out, value.getFile());
writeAdditionalBinDTO(out, value.getAdditionalBin());
writeLocationDTO(out, value.getLocation(), "location");
writeHidden(out, value.getHidden());
}

Expand Down
24 changes: 24 additions & 0 deletions src/main/java/entity/dto/EnumConstantEntityDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public class EnumConstantEntityDTO extends InternalEntityDTO {
private String File;
private String hidden;
private AdditionalBinDTO additionalBin;
private LocationDTO location;

public EnumConstantEntityDTO() {
}
Expand All @@ -31,6 +32,21 @@ public EnumConstantEntityDTO(
this.additionalBin = additionalBin;
}

public EnumConstantEntityDTO(int id,
String name,
String qualifiedName,
int parentId,
String file,
String hidden,
AdditionalBinDTO additionalBin,
LocationDTO location) {
super(id, name, qualifiedName, parentId, "Enum Constant");
this.File = file;
this.hidden = hidden;
this.additionalBin = additionalBin;
this.location = location;
}

public EnumConstantEntityDTO(
int id,
String name,
Expand Down Expand Up @@ -67,4 +83,12 @@ public String getHidden() {
public void setHidden(String hidden) {
this.hidden = hidden;
}

public LocationDTO getLocation() {
return location;
}

public void setLocation(LocationDTO location) {
this.location = location;
}
}
2 changes: 1 addition & 1 deletion src/main/java/util/EnreFormatParser.java
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private static EntityDTO parseEntityDTO(JSONObject variableObj) {
break;
case "Enum Constant":
res =
new EnumConstantEntityDTO(id, name, qualifiedName, parentId, file, hidden, additionalBinDTO);
new EnumConstantEntityDTO(id, name, qualifiedName, parentId, file, hidden, additionalBinDTO, locationDTO);
break;
case "Annotation":
res =
Expand Down

0 comments on commit e9d419b

Please sign in to comment.