Example usage for com.vaadin.shared.communication LegacyChangeVariablesInvocation LegacyChangeVariablesInvocation

List of usage examples for com.vaadin.shared.communication LegacyChangeVariablesInvocation LegacyChangeVariablesInvocation

Introduction

In this page you can find the example usage for com.vaadin.shared.communication LegacyChangeVariablesInvocation LegacyChangeVariablesInvocation.

Prototype

public LegacyChangeVariablesInvocation(String connectorId, String variableName, Object value) 

Source Link

Usage

From source file:org.semanticsoft.vaaclipse.app.servlet.VaaclipseServerRpcHandler.java

License:Open Source License

private LegacyChangeVariablesInvocation parseLegacyChangeVariablesInvocation(String connectorId,
        String interfaceName, String methodName, LegacyChangeVariablesInvocation previousInvocation,
        JSONArray parametersJson, ConnectorTracker connectorTracker) throws JSONException {
    if (parametersJson.length() != 2) {
        throw new JSONException("Invalid parameters in legacy change variables call. Expected 2, was "
                + parametersJson.length());
    }/* www.j  av  a2 s . c om*/
    String variableName = parametersJson.getString(0);
    UidlValue uidlValue = (UidlValue) JsonCodec.decodeInternalType(UidlValue.class, true, parametersJson.get(1),
            connectorTracker);

    Object value = uidlValue.getValue();

    if (previousInvocation != null && previousInvocation.getConnectorId().equals(connectorId)) {
        previousInvocation.setVariableChange(variableName, value);
        return null;
    } else {
        return new LegacyChangeVariablesInvocation(connectorId, variableName, value);
    }
}