Newer
Older
task-bldg / src / main / java / osm / surveyor / task / util / JsonCrs.java
@haya4 haya4 on 27 Jul 2022 835 bytes OK: "/tasks/00000"の地図表示
  1. package osm.surveyor.task.util;
  2.  
  3. import com.fasterxml.jackson.databind.JsonNode;
  4.  
  5. import lombok.Getter;
  6. import lombok.Setter;
  7.  
  8. /**
  9. "crs": {
  10. "type":"name",
  11. "properties":{
  12. "name":"urn:ogc:def:crs:OGC:1.3:CRS84"
  13. }
  14. }
  15. */
  16. @Getter
  17. @Setter
  18. public class JsonCrs extends JsonTemple {
  19. private String type = "name";
  20. private JsonProperties properties;
  21. public String toString() {
  22. StringBuffer sb = new StringBuffer();
  23. boolean c1 = false;
  24. sb.append("{");
  25. c1 = outStr(c1, sb, "type", this.type);
  26. c1 = out(c1, sb, "properties", this.properties);
  27. sb.append("}");
  28. return sb.toString();
  29. }
  30. public void parse(JsonNode node) {
  31. setType(node.get("type").textValue());
  32. JsonNode node1 = node.get("properties");
  33. if (node1 != null) {
  34. this.properties = new JsonProperties();
  35. this.properties.parse(node1);
  36. }
  37. }
  38. }