Package com.esri.gpt.framework.dcat.json

Examples of com.esri.gpt.framework.dcat.json.JsonAttribute


    String attrName = jsonReader.nextName();
    while (jsonReader.hasNext()) {
      JsonToken token = jsonReader.peek();
      switch (token) {
        case STRING:
          record.put(attrName, new JsonAttribute(jsonReader.nextString()));
          return;
        case NUMBER:
          record.put(attrName, new JsonAttribute(jsonReader.nextDouble()));
          return;
        case BOOLEAN:
          record.put(attrName, new JsonAttribute(jsonReader.nextBoolean()));
          return;
        case BEGIN_ARRAY:
          if ("distribution".equals(attrName)) {
            jsonReader.beginArray();
            parseDistributions(record.getDistribution());
View Full Code Here


      switch (token) {
        case END_ARRAY:
          jsonReader.endArray();
          break;
        case STRING:
          keywords.add(new JsonAttribute(jsonReader.nextString()));
          break;
        case NUMBER:
          keywords.add(new JsonAttribute(jsonReader.nextDouble()));
          break;
        case BOOLEAN:
          keywords.add(new JsonAttribute(jsonReader.nextBoolean()));
          break;
        default:
          throw new DcatParseException("Unexpected token in the data: " + token);
      }
    }
View Full Code Here

    String attrName = jsonReader.nextName();
    while (jsonReader.hasNext()) {
      JsonToken token = jsonReader.peek();
      switch (token) {
        case STRING:
          attributes.put(attrName, new JsonAttribute(jsonReader.nextString()));
          return;
        case NUMBER:
          attributes.put(attrName, new JsonAttribute(jsonReader.nextDouble()));
          return;
        case BOOLEAN:
          attributes.put(attrName, new JsonAttribute(jsonReader.nextBoolean()));
          return;
        default:
          throw new DcatParseException("Unexpected token in the data: " + token);
      }
    }
View Full Code Here

   * Gets attribute.
   * @param name attribute name
   * @return attribute value
   */
  protected String getString(String name) {
    JsonAttribute attr = attrs.get(name);
    return attr!=null? attr.getString(): "";
  }
View Full Code Here

TOP

Related Classes of com.esri.gpt.framework.dcat.json.JsonAttribute

Copyright © 2018 www.massapicom. 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.