title: Converting JsonNode to java array
body: <p>I am working on Play framewrok 2 with websocket and JsonNode . the front end is connected to the play framework backend by use of websocket. I converted a javascript array into a json node and sent it to the backend by the use of the webscoket connection. 
  Now my problem is how do i convert the json object into a a java array or any suitable structure so that i can manipulate the data.</p>
  
  <p>this is the json object I created </p>
  
  <pre><code>var myjeson = {"x":arrayX,"y":arrayY} ;
  </code></pre>
  
  <p>this is the array which is populated dynamically      </p>
  
  <pre><code> function pixelCount ()
      {  arrayX[counter] = xcoordinate;        
      arrayY[counter] = ycoordinate;
      socket.send(" from array X,Y  "+arrayX[counter]+ " " +arrayY[counter]); 
      ++counter;      
      }
  </code></pre>
  
  <p>the code below sends the data </p>
  
  <pre><code>$('button.send').click(function() {            
  sock.send(JSON.stringify(myjeson)); 
  </code></pre>
  
  <p>on the server side i have the following code </p>
  
  <pre><code> public static WebSocket&lt;JsonNode&gt; givenIn() {
      return new WebSocket&lt;JsonNode&gt;() {
      // called when the websocket is established
      public void onReady(WebSocket.In&lt;JsonNode&gt; in, WebSocket.Out&lt;JsonNode&gt; out) {
      // register a callback for processing instream events             
      in.onMessage(new Callback&lt;JsonNode&gt;() {
      public void invoke(JsonNode event) {                 
      Logger.info(event.toString());
      }
  </code></pre>
  
  <p>when I check the log the message is delivered :
  below is the log info
  [info] application - </p>
  
  <pre><code>{"x":
  [78.72727298736572,79.72727298736572,82.72727298736572,
  7298736572,93.72727298736572,83.72727298736572132.72727298736572],
  
  "y":
  [82.6363639831543,82.6363639831543,63.54545593261719,63.54545593261719,64.545455932
  61719,65.54545593261719,70.54545593261719,189.5454559326172,188.5454559326172]}
  </code></pre>
  
  <p>Now I will like to place these data in an array so that I can access them.
  any suggestion will be appreciated.an alternative suggestion is also welcomed.</p>