Examples of JsonException


Examples of net.sf.json.JSONException

    this.other_type = other_type;
  }
 
  @Override
  public void checkException() throws JSONException {
    throw new JSONException(message);
  }
View Full Code Here

Examples of org.amplafi.json.JSONException

            return null;
        }
        try {
            return (K) Enum.valueOf((Class<? extends Enum>) clazz, value.toString());
        } catch (IllegalArgumentException e) {
            throw new JSONException(e);
        }
    }
View Full Code Here

Examples of org.apache.sling.commons.json.JSONException

        for (int i=0; i < jsonArray.length(); i++) {
          Object object = jsonArray.get(i);
          if (object instanceof JSONObject) {
              createPrincipal((JSONObject)object, contentCreator);
          } else {
            throw new JSONException("Unexpected data type in principals array: " + object.getClass().getName());
          }
        }
      }
    }
View Full Code Here

Examples of org.apache.sling.commons.json.JSONException

        for (int i=0; i < jsonArray.length(); i++) {
          Object object = jsonArray.get(i);
          if (object instanceof JSONObject) {
              createAce((JSONObject)object, contentCreator);
          } else {
            throw new JSONException("Unexpected data type in acl array: " + object.getClass().getName());
          }
        }
      }
    }
View Full Code Here

Examples of org.apache.sling.commons.json.JSONException

        if (value instanceof JSONString) {
            Object o;
            try {
                o = ((JSONString)value).toJSONString();
            } catch (Exception e) {
                throw new JSONException(e);
            }
            if (o instanceof String) {
                return (String)o;
            }
            throw new JSONException("Bad value from toJSONString: " + o);
        }
        if (value instanceof Number) {
            return numberToString((Number) value);
        }
        if (value instanceof Boolean || value instanceof JSONObject ||
View Full Code Here

Examples of org.apache.sling.commons.json.JSONException

     * @throws JSONException If n is a non-finite number.
     */
    public String numberToString(Number n)
            throws JSONException {
        if (n == null) {
            throw new JSONException("Null pointer");
        }
        testNumberValidity(n);

        // Shave off trailing zeros and decimal point, if possible.

View Full Code Here

Examples of org.apache.sling.commons.json.JSONException

     */
    public void testNumberValidity(Object o) throws JSONException {
        if (o != null) {
            if (o instanceof Double) {
                if (((Double)o).isInfinite() || ((Double)o).isNaN()) {
                    throw new JSONException(
                        "JSON does not allow non-finite numbers");
                }
            } else if (o instanceof Float) {
                if (((Float)o).isInfinite() || ((Float)o).isNaN()) {
                    throw new JSONException(
                        "JSON does not allow non-finite numbers.");
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.sling.commons.json.JSONException

               b = true;
           }
           writer.write('}');
           return writer;
       } catch (IOException e) {
           throw new JSONException(e);
       }
    }
View Full Code Here

Examples of org.apache.sling.commons.json.JSONException

                b = true;
            }
            writer.write(']');
            return writer;
        } catch (IOException e) {
           throw new JSONException(e);
        }
    }
View Full Code Here

Examples of org.apache.wicket.ajax.json.JSONException

// Close tag </

                        token = x.nextToken();
                        if (!(token instanceof String)) {
                            throw new JSONException(
                                    "Expected a closing name instead of '" +
                                    token + "'.");
                        }
                        if (x.nextToken() != XML.GT) {
                            throw x.syntaxError("Misshaped close tag");
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.