Package flexjson

Examples of flexjson.JSONSerializer


public class ExportSerializer {

    public static final String JSON_EXTENSION = ".json";
   
    public void toJSON(@Nonnull ReadableRoot node, @Nonnull String path) {
        String json = new JSONSerializer().prettyPrint(true).deepSerialize(node);
        saveText(json, path);
    }
View Full Code Here


public class ExportSerializer {

    public static final String JSON_EXTENSION = ".json";

    public void toJSON(@Nonnull Object node, @Nonnull String path) {
        String json = new JSONSerializer().prettyPrint(true).deepSerialize(node);
        saveText(json, path);
    }
View Full Code Here

        {
            HashMap<String, String> tokenToHostMap = new HashMap<String,String>();
            Map<Token, EndPoint> endpointMap = storageService.getLiveEndPointMap();
            for (Map.Entry<Token, EndPoint> e : endpointMap.entrySet())
                tokenToHostMap.put(e.getKey().toString(), e.getValue().getHost());
            return new JSONSerializer().serialize(tokenToHostMap);
        }
        else if (propertyName.equals("version"))
        {
            return "0.4.2";
        }
View Full Code Here

        {
            HashMap<String, String> tokenToHostMap = new HashMap<String,String>();
            Map<Token, EndPoint> endpointMap = storageService.getLiveEndPointMap();
            for (Map.Entry<Token, EndPoint> e : endpointMap.entrySet())
                tokenToHostMap.put(e.getKey().toString(), e.getValue().getHost());
            return new JSONSerializer().serialize(tokenToHostMap);
        }
        else if (propertyName.equals("version"))
        {
            return "0.4.1";
        }
View Full Code Here

        {
            HashMap<String, String> tokenToHostMap = new HashMap<String,String>();
            Map<Token, EndPoint> endpointMap = storageService.getLiveEndPointMap();
            for (Map.Entry<Token, EndPoint> e : endpointMap.entrySet())
                tokenToHostMap.put(e.getKey().toString(), e.getValue().getHost());
            return new JSONSerializer().serialize(tokenToHostMap);
        }
        else if (propertyName.equals("version"))
        {
            return "0.4.0";
        }
View Full Code Here

  /**
   * Constructor
   * @param manager
   */
  public JSONTranscoder(final Manager manager) {
    serializer = new JSONSerializer();
    if (LOG.isDebugEnabled()) {
        LOG.debug("Initialized json serializer");
    }
  }
View Full Code Here

    return jsonSerializer.deepSerialize(object);
  }

  private JSONSerializer createSerializer()
  {
    jsonSerializer= new JSONSerializer();
    jsonSerializer.transform(new ElementTrasformer(), Element.class);
    jsonSerializer.transform(new MethodTrasformer(), Method.class);
    jsonSerializer.transform(new DragomeClassTransformer(), Class.class);
    return jsonSerializer;
  }
View Full Code Here

                return "file not found!";
            }
        }
        else if (propertyName.equals(TOKEN_MAP))
        {
            return new JSONSerializer().serialize(storageService.getStringEndpointMap());
        }
        else if (propertyName.equals("version"))
        {
            return Constants.VERSION;
        }
View Full Code Here

    }
   
    @Override
    public String serializeObject(Object o)
    {
        JSONSerializer S = new JSONSerializer().include("*").exclude("class");
       
        Log.log("Serialized obj : " + S.deepSerialize(o));
       
        return S.deepSerialize(o);
    }
View Full Code Here

                                // FIXME : faudrait pas plutôt sérialiser la définition de la classe
                                // pour la donner au serveur, plutôt qu'une instance ?
                                // et où sont les actions pour les instances, d'ailleurs ?
       
        /* FIXME : simple serialization using FlexJSON. */
        JSONSerializer serializer = new JSONSerializer().include("*");
               
        BufferedWriter writer = new BufferedWriter(new FileWriter("serialized.txt"));
        serializer.deepSerialize(instance, writer);
        writer.close(); /* not very clean. */
      }
      catch (Exception e)
      {
        e.printStackTrace();
View Full Code Here

TOP

Related Classes of flexjson.JSONSerializer

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.