Examples of nextValue()


Examples of org.json.JSONTokener.nextValue()

     * @throws org.json.JSONException
     */
    protected JSONObject parseJSON(String content, String startTag) throws JSONException {
        String json = content.substring(content.indexOf(startTag) + startTag.length());
        JSONTokener jsonTokener = new JSONTokener(json);
        Object o = jsonTokener.nextValue();
        return (JSONObject) o;
    }

    /**
     * 将一段字符串解析为JSONObject
 
View Full Code Here

Examples of org.json.JSONTokener.nextValue()

     */
    protected JSONObject parseJSON(String content, String startTag, String endTag) throws JSONException {
        String sub_content = content.substring(content.indexOf(startTag) + startTag.length());
        String json = sub_content.substring(0, sub_content.indexOf(endTag));
        JSONTokener jsonTokener = new JSONTokener(json);
        Object o = jsonTokener.nextValue();
        return (JSONObject) o;
    }

    /**
     * 判断是否是正确的email地址
 
View Full Code Here

Examples of org.json.JSONTokener.nextValue()

                                                          jsonString));
            case '}':
                return;
            default:
                x.back();
                key = x.nextValue().toString();
            }

            /*
             * The key is followed by ':'. We will also tolerate '=' or '=>'.
             */
 
View Full Code Here

Examples of org.json.JSONTokener.nextValue()

                }
            } else if (c != ':') {
                throw new IllegalArgumentException(format("String '%s' is not a valid JSON object representation, expected a ':' after the key '%s'",
                                                          jsonString, key));
            }
            Object value = x.nextValue();

            // guard from null values
            if (value != null) {
                if (value instanceof JSONArray) { // only plain simple arrays in this version
                    JSONArray array = (JSONArray) value;
View Full Code Here

Examples of org.json.JSONTokener.nextValue()

                            throws IOException
                        {
                            try
                            {
                                JSONTokener tokener = new JSONTokener( item );
                                JSONObject entity = (JSONObject) tokener.nextValue();
                                String id = entity.getString( JSONKeys.identity.name() );
                                store.put( new EntityReference( id ), item );
                            }
                            catch( JSONException e )
                            {
View Full Code Here

Examples of org.json.JSONTokener.nextValue()

     */
    public Object fromJSON(String jsonString) throws UnmarshallException {
        JSONTokener tok = new JSONTokener(jsonString);
        Object json;
        try {
            json = tok.nextValue();
        } catch (JSONException e) {
            throw new UnmarshallException("couldn't parse JSON", e);
        }
        SerializerState state = new SerializerState();
        return this.unmarshall(state, null, json);
View Full Code Here

Examples of org.rhq.plugins.perftest.calltime.CalltimeFactory.nextValue()

        TraitFactory traitFactory = scenarioManager.getTraitFactory(resourceTypeName);

        for (MeasurementScheduleRequest metric : metrics) {
            switch (metric.getDataType()) {
                case CALLTIME:
                    CallTimeData callTimeData = calltimeFactory.nextValue(metric);
                    if (callTimeData!=null) {
                        report.addData(callTimeData);
                    }
                    break;
                case MEASUREMENT:
View Full Code Here

Examples of org.rhq.plugins.perftest.measurement.MeasurementFactory.nextValue()

        ScenarioManager manager = ScenarioManager.getInstance();
        MeasurementFactory measurementFactory = manager.getMeasurementFactory("service-e-metrics");
        MeasurementScheduleRequest request = new MeasurementScheduleRequest(1000, "name", 30000, true,
            DataType.MEASUREMENT);

        MeasurementData data = measurementFactory.nextValue(request);
        Double value = (Double) data.getValue();

        // the OOBNumericMeasurementFactory algorithm uses millis from midnight GMT/UTC when calculating day of week,
        // so do the same here
        Calendar cal = Calendar.getInstance(new SimpleTimeZone(0, "UTC"));
View Full Code Here

Examples of org.rhq.plugins.perftest.measurement.MeasurementFactory.nextValue()

                    if (callTimeData!=null) {
                        report.addData(callTimeData);
                    }
                    break;
                case MEASUREMENT:
                    MeasurementDataNumeric measurementData = (MeasurementDataNumeric) measurementFactory.nextValue(metric);

                    if (measurementData != null) {
                        report.addData(measurementData);
                    }
                    break;
View Full Code Here

Examples of org.rhq.plugins.perftest.trait.TraitFactory.nextValue()

                    if (measurementData != null) {
                        report.addData(measurementData);
                    }
                    break;
                case TRAIT:
                    MeasurementDataTrait measurementDataTrait = traitFactory.nextValue(metric);
                    if (measurementDataTrait != null) {
                        report.addData(measurementDataTrait);
                    }
                    break;
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.