Examples of Json


Examples of gmusic.api.comm.JSON

    protected final IJsonDeserializer deserializer;
    protected final File storageDirectory;

    public GoogleMusicAPI()
    {
        this(new HttpUrlConnector(), new JSON(), new File("."));
    }
View Full Code Here

Examples of grails.converters.JSON

    @Override
    protected Object encodeAsJsonObject(Object o) {
        if(o instanceof JSON) {
            return o;
        } else {
            return new JSON(o);
        }
    }
View Full Code Here

Examples of json.Json

            }
        }
        return body;
    }
    public final Json getBodyJson(){
        Json body = this.bodyJson;
        if (null == body){
            try {
                body = (new json.Reader().read(this.getBodyString()));
                this.bodyJson = body;
            }
View Full Code Here

Examples of jsonij.json.JSON

                + "         \"Zip\":       \"94085\","
                + "         \"Country\":   \"US\""
                + "      }"
                + "   ]";
        for (int i = 0; i < 10000; i++) {
            JSON json = JSON.parse(input);
            String outputJSON = json.toJSON();
        }
    }
View Full Code Here

Examples of juzu.impl.common.JSON

 
  /** .*/
  private ServiceContext context;

  ShiroDescriptor(ServiceContext context) {
    JSON config = context.getConfig();
    this.authenticater = new ShiroAuthenticator(config.get("rememberMe") != null ? true : false);
    this.authorizer = new ShiroAuthorizor();
    this.context = context;
    this.bean =
      BeanDescriptor
        .createFromProvider(SecurityManager.class, Scope.SESSION, null, new SecurityManagerProvider(config));
View Full Code Here

Examples of mjson.Json

    /**
     * Initialized the JFrame and Tabbed Panel on it<br />
     * Fetches the search token from reittiopas site<br />
     */
    public eMainWindow() {
        Json AllData  = null;
        String strLine = "";
        BufferedReader br = null;
        try { // read all name of the places from file LocationData saved in JSON format
            DataInputStream in = new DataInputStream(getClass().getResource("LocationData").openStream());
            br = new BufferedReader(new InputStreamReader(in));
            while ((strLine = br.readLine())!= null)   {
                break;
            }
            AllData = Json.read(strLine); //convert text to JSON object
            in.close();
        } catch (IOException ex) {
            Logger.getLogger(cLoginWindow.class.getName()).log(Level.SEVERE,"Cannot read the file with data", ex);
        }
       
        // Reittiopas uses token to verify the requests which comes in the following link(http://reittiopas.turku.fi/fi/config.js_b8d9ad995abbbe6251c6c1c2b1017cd0e71e286b.php), which is normal javascript file
        String tokenText=null;
       
        //request for the token
        bFetchURL requestForToken = new bFetchURL("http://reittiopas.turku.fi/fi/config.js_b8d9ad995abbbe6251c6c1c2b1017cd0e71e286b.php", new HashMap<String, String>(){{put("","");}}, "GET");
        try {
            tokenText = requestForToken.content();
        }
        catch (NullPointerException ex){
            JOptionPane.showMessageDialog(null, "Sorry couldn't read the URL for search token, exiting the application", "Fatal error", JOptionPane.ERROR_MESSAGE);
            System.exit(-1);
        }
        catch (IOException ex) {
            JOptionPane.showMessageDialog(null, "Sorry couldn't read the URL for token, exiting the application", "Fatal error", JOptionPane.ERROR_MESSAGE);
            System.exit(-1);
        }
        try{ //parse the token, if we got the response.
            token = Json.read(tokenText.substring(11, tokenText.length())).at("token").asString();
        }
        catch(NullPointerException ex){ //if token couldn't be parsed application cannot initialize i.e. there is no use of application
            JOptionPane.showMessageDialog(null, "Sorry couldn't parse the search token, exiting the application");
            System.exit(-1);
        }
        Datas = AllData.asJsonMap(); //convert all the location's object into Map<String, Json>
        List a = new ArrayList();
        a.add("");
        for(Entry<String, Json> entry : Datas.entrySet()) { //break each item from Map and make it to a List
            String key = entry.getKey();
            a.add(key);
View Full Code Here

Examples of net.arnx.jsonic.JSON

  public void init(ServletConfig servletConfig) throws ServletException {
    super.init(servletConfig);
   
    String configText = servletConfig.getInitParameter("config");
   
    JSON json = new JSON();
   
    if (configText == null) {
      Map<String, String> map = new HashMap<String, String>();
      Enumeration<String> e =  cast(servletConfig.getInitParameterNames());
      while (e.hasMoreElements()) {
        map.put(e.nextElement(), servletConfig.getInitParameter(e.nextElement()));
      }
      configText = json.format(map);
    }
   
    try {
      config = json.parse(configText, Config.class);
      if (config.container == null) config.container = Container.class;
      container = json.parse(configText, config.container);
      container.init(this);
    } catch (Exception e) {
      throw new ServletException(e);
    }
   
View Full Code Here

Examples of net.sf.json.JSON

    action.setQ("");
    String okay = action.execute();
    assertEquals(ActionSupport.SUCCESS,okay);
    List<String> tags = action.getSkosRelatedTags();
    assertTrue(tags.isEmpty());
    JSON json = action.getJsonResult();
    assertEquals("{}",json.toString());
  }
View Full Code Here

Examples of net.sf.json.JSON

    if(jsonName == null){
      final String message = "Required parameter 'jsonName' is not found.";
      throw new RuntimeException(message);
    }
    ServletActionContext.getResponse().setContentType("text/javascript; charset=UTF-8");
    JSON json = (JSON)actionInvocation.getStack().findValue(jsonName);
    if(json != null){
      Writer out = null;
      try{
        out = ServletActionContext.getResponse().getWriter();
        out.append(json.toString());
      }catch(Exception e){
        logger.error("Error write json object: " + e.getMessage(), e);
      }finally{
        if(out != null){
          out.close();
View Full Code Here

Examples of net.sf.json.JSON

     *
     * @see de.netseeker.ejoe.adapter.SerializeAdapter#write(java.lang.Object, java.io.OutputStream)
     */
    public void write( Object obj, OutputStream out ) throws Exception
    {
        JSON json = null;
       
        if( JSONUtils.isObject( obj ))
        {
            json = JSONObject.fromObject( obj );           
        }
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.