Examples of JsonNode


Examples of org.codehaus.jackson.JsonNode

      (message+", at line "+token.beginLine+", column "+token.beginColumn);
  }

  private String getTextProp(String key, Map<String,JsonNode> props,
                             Token token) throws ParseException {
    JsonNode value = props.get(key);
    if (value.isTextual())
      return value.getTextValue();
    throw error(key+" property must be textual: "+value, token);
  }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

    throw error(key+" property must be textual: "+value, token);
  }

  private List<String> getTextProps(String key, Map<String,JsonNode> props,
                             Token token) throws ParseException {
    JsonNode value = props.get(key);
    if (!value.isArray())
      throw error(key+" property must be array: "+value, token);
    List<String> values = new ArrayList<String>();
    for (JsonNode n : value)
      if (n.isTextual())
        values.add(n.getTextValue());
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

    throw new Error("Missing return statement in function");
  }

  final public void SchemaProperty(Map<String, JsonNode> properties) throws ParseException {
  String key;
  JsonNode val;
    jj_consume_token(AT);
    key = Identifier();
    jj_consume_token(LPAREN);
    val = Json();
    jj_consume_token(RPAREN);
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

      type.addProp(key, getTextProp(key, props, token));
  }

  final public void VariableDeclarator(Schema type, List<Field> fields) throws ParseException {
  String name;
  JsonNode defaultValue = null;
  Map<String, JsonNode> props = new LinkedHashMap<String, JsonNode>();
    label_9:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case AT:
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

    {if (true) return t;}
    throw new Error("Missing return statement in function");
  }

  final public JsonNode Json() throws ParseException {
  String s; Token t; JsonNode n;
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case STRING_LITERAL:
      s = JsonString();
                     n = new TextNode(s);
      break;
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

    }
  }

  final public void JsonPair(ObjectNode o) throws ParseException {
  String name;
  JsonNode value;
    name = JsonString();
    jj_consume_token(COLON);
    value = Json();
      o.put(name, value);
  }
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

      {if (true) return a;}
    throw new Error("Missing return statement in function");
  }

  final public void JsonElements(ArrayNode a) throws ParseException {
  JsonNode element;
    element = Json();
                   a.add(element);
    switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
    case COMMA:
      jj_consume_token(COMMA);
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

    return parseLocationFromPath(locationField, "wfs").get(0);

  }
 
  private static List<String> parseLocationFromPath(String locationField, String path) throws JsonParseException{
    JsonNode rootNode = parseLocationField(locationField);
    JsonNode pathNode = rootNode.path(path);
    Set<String> url = new HashSet<String>();
    if (pathNode.isMissingNode()){
     
      throw new JsonParseException("The Object '" + path + "' could not be found.", null);
     
    } else if (pathNode.isArray()){
     
      ArrayNode urls = (ArrayNode) rootNode.path(path);
      for(JsonNode currentUrl: urls){
        url.add(currentUrl.getTextValue());
      }
     
    } else if (pathNode.isTextual()){
      url.add(pathNode.getTextValue());
    }

    if (url == null || url.isEmpty()){
     
      throw new JsonParseException("The Object '" + path + "' is empty.", null);
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

    locationField.replaceAll("(?i)\"download\"", "\"fileDownload\"");
    locationField.replaceAll("(?i)\"fileDownload\"", "\"fileDownload\"");
    locationField.replaceAll("(?i)\"tilecache\"", "\"tilecache\"");

    ObjectMapper mapper = new ObjectMapper();
    JsonNode rootNode = null;
    try {
      rootNode = mapper.readTree(locationField);
    } catch (JsonProcessingException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
View Full Code Here

Examples of org.codehaus.jackson.JsonNode

  public @ResponseBody Map<String,String> handleExportRequest(HttpServletRequest request)
      throws ServletException, IOException {
    //given a list of ogpids, export them to geocommons
    //read the POST'ed JSON object
    ObjectMapper mapper = new ObjectMapper();
    JsonNode rootNode = mapper.readTree(request.getInputStream());
    String basemap = rootNode.path("basemap").getTextValue();
    String bbox = rootNode.path("extent").getTextValue();
    String username = rootNode.path("username").getTextValue();
    String password = rootNode.path("password").getTextValue();
   
    ObjectNode responseJson = mapper.createObjectNode();
    //response json format
    //{"status": "", "message": "", mapUrl: "", "layers": []}
    //status  where in the process
    //statusMessage text
    //mapUrl:
    //layers
    //layerId:
    //progress: dataset, map
    //format: shp, wms, etc.
    //url:

    /*if ((username.isEmpty())||(password.isEmpty())){
      response.sendError(500, "This request requires a valid GeoCommons username and password.");
      return;
    }*/
    String title = rootNode.path("title").getTextValue();
    String description = rootNode.path("description").getTextValue();
    JsonNode idArray = rootNode.path("OGPIDS");
    ArrayList<String> layers = new ArrayList<String>();
    for (JsonNode idNode : idArray){
      layers.add(idNode.getTextValue());
    }
    /*if (layers.isEmpty()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.