Examples of JSONSerializer


Examples of org.apache.pivot.serialization.JSONSerializer

    private void load(URL location) {
        try {
            InputStream inputStream = location.openStream();

            try {
                JSONSerializer serializer = new JSONSerializer();
                Map<String, ?> properties = (Map<String, ?>)serializer.readObject(inputStream);

                font = Font.decode((String)properties.get("font"));

                List<String> colorCodes = (List<String>)properties.get("colors");
                colors = new Color[colorCodes.getLength() * 3];
 
View Full Code Here

Examples of org.auto.json.JsonSerializer

    }

  }

  public static void testJson() {
    JsonSerializer jsonSerializer = new JsonSerializer();

    JsonArray array = new JsonArray();
    Person person = new Person();
    person.setAge(23);
    Person person1 = new Person();
    person1.setName("haha");
    person.setPerson(person1);

    array.add(person);
    array.add(4);
    array.add("this is a String");
    array.add('c');
    array.add(true);
    array.add(null);
    JsonObject jsonObject = new JsonObject();
    jsonObject.put("name", "hehe");
    jsonObject.put("sdf", new JsonObject());
    jsonObject.put("khiyiu", null);
    array.add(jsonObject);
    array.add(new JsonObject());

    String jsonString = jsonSerializer.toJsonString(person);

    JsonDeserializer deserializer = new JsonDeserializer();
    Person dperson = (Person) deserializer.toObject(jsonString,
        Person.class);

    System.out.println(jsonString);
    System.out.println(jsonSerializer.toJsonString(dperson));
  }
View Full Code Here

Examples of org.codehaus.jackson.map.JsonSerializer

        }
      }
      jsonGenerator.writeString(value);
      // end write property type
      // start write property value
      JsonSerializer s = serializerProvider.findValueSerializer(property.getValue().getClass(), null);
      s.serialize(property.getValue(), jsonGenerator, serializerProvider);
      // end write property value
      jsonGenerator.writeEndArray();
      // end write property
    }
    jsonGenerator.writeEndArray();
View Full Code Here

Examples of org.directwebremoting.json.serialize.JsonSerializer

     * Convert arbitrary convertible data into a JSON string and write it out
     * to the given Writer
     */
    public static void toJson(Object data, Writer out) throws IOException
    {
        JsonSerializer serializer = JsonSerializerFactory.get();
        serializer.toJson(data, out);
    }
View Full Code Here

Examples of org.eclipse.orion.server.core.resources.JSONSerializer

  protected URI cloneLocation;
  protected Repository db;
  private StoredConfig cfg;

  private GitObject() {
    this.jsonSerializer = new JSONSerializer();
  }
View Full Code Here

Examples of org.eclipse.persistence.sessions.serializers.JSONSerializer

     * INTERNAL:
     * Every converter needs to be able to process themselves.
     */
    @Override
    public void process(DatabaseMapping mapping, MappingAccessor accessor, MetadataClass referenceClass, boolean isForMapKey) {
        setConverter(mapping, new SerializedObjectConverter(mapping, new JSONSerializer()), isForMapKey);
    }
View Full Code Here

Examples of org.jabsorb.JSONSerializer

public class JSON2JavaBean {
    private JSONSerializer serializer;

    public JSON2JavaBean() {
        super();
        serializer = new JSONSerializer();
        try {
            serializer.registerDefaultSerializers();
            EnumSerializer enumSerializer = new EnumSerializer();
            serializer.registerSerializer(enumSerializer);
            serializer.registerSerializer(new BigIntegerSerializer());
View Full Code Here

Examples of org.jabsorb.JSONSerializer

public class JavaBean2JSON {
    private JSONSerializer serializer;
   
    public JavaBean2JSON() {
        serializer = new JSONSerializer();
        try {
            serializer.registerDefaultSerializers();
            EnumSerializer enumSerializer = new EnumSerializer();         
            serializer.registerSerializer(enumSerializer);
            serializer.registerSerializer(new BigIntegerSerializer());
View Full Code Here

Examples of org.jabsorb.JSONSerializer

public class JSON2JavaBean implements PullTransformer<Object, Object> {
    private JSONSerializer serializer;

    public JSON2JavaBean() {
        super();
        serializer = new JSONSerializer();
        try {
            serializer.registerDefaultSerializers();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

Examples of org.neo4j.cypherdsl.result.JSONSerializer

    }, autoIndexNodes = true)
    public void testJSONSerialization()
    {
        data.get();

        JSONSerializer serializer = new JSONSerializer();
        String query = start( lookup( "john", "node_auto_index", "name", "John" ) ).
                match( node( "john" ).out( "friend" ).node().out( "friend" ).node( "fof" ) ).
                returns( as( identifier( "john" ).property( "name" ), "name" ), as( identifier( "fof" ).property(
                        "name" ), "friend" ), identifier( "john" ), as( count(), "count" ) )
                .toString();
        try (Transaction tx = graphdb.beginTx()) {
            String json = serializer.toJSON( engine.execute( query ) ).toString();
            System.out.println( json );
            tx.success();
        }
    }
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.