valuesToParse = allowedValues.getJSONArray(0); } else { valuesToParse = allowedValues;
valuesToParse = allowedValues.getJSONArray(0); } else { valuesToParse = allowedValues;
valuesToParse = allowedValues.getJSONArray(0);
valuesToParse = allowedValues.getJSONArray(0);
childJa = ja.getJSONArray(index); } catch (JSONException ex) {
childJa = ja.getJSONArray(index); } catch (JSONException ex) {
JSONArray rows = source.getJSONArray(i); short master = (short) rows.getInt(0); int replicaSize = rows.length() - 1;
private static boolean compareArray( JSONArray jsa1, JSONArray jsa2, int i ) throws JSONException { KeyType keyType = getKeyType( jsa1, i ); if ( keyType == getKeyType( jsa2, i ) ) { if ( keyType == KeyType.OBJECT ) { return jsonEqual( jsa1.getJSONObject( i ), jsa2.getJSONObject( i ), null ); } else { if ( keyType == KeyType.ARRAY ) { return jsonEqual( jsa1.getJSONArray( i ), jsa2.getJSONArray( i ), null ); } else { return jsa1.getString( i ).equals( jsa2.getString( i ) ); } } } return false; }
private boolean sameArray(ArrayValue want, JSONArray parent, int index) throws Exception { trace("comparing array array element " + index); indent(); try { try { if (sameArray(want, parent.getJSONArray(index))) { trace("same array"); return true; } else { trace("different array"); return false; } } catch (JSONException e) { trace("different since property was not an array"); return false; } } finally { undent(); } }
@Override public void valueChange(ValueChangeEvent evt) { String mapContent = mapContentConnector.getConnectorValue(); if (mapContent != null) { try { JSONObject mapContentAsJson = new JSONObject(mapContent); JSONArray markers = mapContentAsJson.optJSONArray(MapHelper.MARKERS_KEY); if (markers != null && markers.length() > 0) { JSONArray marker = markers.getJSONArray(0); mapView.setCenter(marker.getDouble(1), marker.getDouble(0)); mapView.setVisible(true); } else { mapView.setVisible(false); } } catch (JSONException e) { throw new ConnectorBindingException(e, "Invalid Json map content"); } } else { mapView.setVisible(false); } } };
PublicationDate publicationDate = new PublicationDate(); try { JSONArray dateArray = dateParts.getJSONArray(0); JSONObject issued = (JSONObject) json.get("issued"); JSONArray dateParts = issued.getJSONArray("date-parts"); JSONArray date = dateParts.getJSONArray(0);
if(sources != null) { sourcesList = new ArrayList<String>(); JSONArray sourcesArray = sources.getJSONArray(i);