Examples of JSONSerializer


Examples of com.fasterxml.jackson.databind.JsonSerializer

    public static DBObject serializeQuery(ObjectMapper objectMapper,
            JavaType type, DBQuery.Query query) {
        SerializerProvider serializerProvider = JacksonAccessor
                .getSerializerProvider(objectMapper);
        JsonSerializer serializer = JacksonAccessor.findValueSerializer(
                serializerProvider, type);
        return serializeQuery(serializerProvider, serializer, query);
    }
View Full Code Here

Examples of com.metaparadigm.jsonrpc.JSONSerializer

  JSONSerializer message2Object;
 
  public Client(Session session) {
    try {
      this.session= session;
      message2Object= new JSONSerializer();
      message2Object.registerDefaultSerializers();
    } catch (Exception e) {
      throw new ClientError(e);
    }
  }
View Full Code Here

Examples of com.metaparadigm.jsonrpc.JSONSerializer

public class JavaBean2JSON extends BaseTransformer<Object, Object> implements PullTransformer<Object, Object> {
    private JSONSerializer serializer;
   
    public JavaBean2JSON() {
        serializer = new JSONSerializer();
        try {
            serializer.registerDefaultSerializers();
        } catch (Exception e) {
            throw new TransformationException(e);
        }
View Full Code Here

Examples of com.metaparadigm.jsonrpc.JSONSerializer

public class JSON2JavaBean extends BaseTransformer<Object, Object> 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 com.stoyanr.todo.client.presenter.JsonSerializer

        Object[] args = inv.getArguments();
        return stored.get((String) args[0]);
    }

    public static JsonSerializer createMockSerializer() {
        JsonSerializer ser = mock(JsonSerializer.class);
        // @formatter:off
        when(ser.toString(any(Document.class))).thenAnswer(new Answer<String>() {
            public String answer(InvocationOnMock inv) {
                Document doc = (Document) inv.getArguments()[0];
                serialized.put(doc.getUserId(), doc);
                return doc.getUserId();
            }
        });
        when(ser.toString(any(Item.class))).thenAnswer(new Answer<String>() {
            public String answer(InvocationOnMock inv) {
                Item item = (Item) inv.getArguments()[0];
                String key = String.valueOf(item.getId());
                serialized.put(key, item);
                return key;
            }
        });
        when(ser.getDocument(anyString())).thenAnswer(new Answer<Document>() {
            public Document answer(InvocationOnMock inv) {
                String key = (String) inv.getArguments()[0];
                return (Document) serialized.get(key);
            }
        });
        when(ser.getItem(anyString())).thenAnswer(new Answer<Item>() {
            public Item answer(InvocationOnMock inv) {
                String key = (String) inv.getArguments()[0];
                return (Item) serialized.get(key);
            }
        });
View Full Code Here

Examples of com.vaadin.server.communication.JSONSerializer

        return typeToTransportType.get(getClassForType(valueType));
    }

    private static JsonValue serializeJson(Object value,
            ConnectorTracker connectorTracker) {
        JSONSerializer serializer = customSerializers.get(value.getClass());
        return serializer.serialize(value, connectorTracker);
    }
View Full Code Here

Examples of flexjson.JSONSerializer

        // need to get overrideId for identifiers..
        Integer overrideId = ControllerUtils.convertOverrideIdentifier(overrideIdentifier);

        // set arguments
        if (arguments != null) {
            JSONSerializer serializer = new JSONSerializer();

            OverrideService.getInstance().updateArguments(overrideId, identifiers.getPathId(), ordinal, serializer.serialize(httpRequest.getParameterValues("arguments[]")), clientUUID);
        }

        // set repeat number
        if (repeatNumber != null) {
            OverrideService.getInstance().updateRepeatNumber(overrideId, identifiers.getPathId(), ordinal, repeatNumber, clientUUID);
View Full Code Here

Examples of flexjson.JSONSerializer

  private Long counter;

  private Double averageRate;

  public String toJson() {
    return new JSONSerializer().exclude("*.class").serialize(this);
  }
 
View Full Code Here

Examples of flexjson.JSONSerializer

  public static LoanShark fromJsonToLoanShark(String json) {
    return new JSONDeserializer<LoanShark>().use(null, LoanShark.class).deserialize(json);
  }

  public static String toJsonArray(Collection<LoanShark> collection) {
    return new JSONSerializer().exclude("*.class").serialize(collection);
  }
 
View Full Code Here

Examples of flexjson.JSONSerializer

  public void setPassword(String password) {
        this.password = password;
    }

  public String toJson() {
        return new JSONSerializer().exclude("*.class").serialize(this);
    }
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.