Examples of JsonValue


Examples of com.voyagegames.core.json.JsonValue

    assertTrue(log.logs.size() == 0);
    assertTrue(obj != null);
    assertTrue(obj.values.size() == 1);
   
    final JsonValue v = obj.values.get(JsonParser.ARRAY_RESULT);
   
    assertTrue(v != null);
    assertTrue(v.type() == JsonValueType.ARRAY);
    assertTrue(v.arrayValue().size() == 2);
    assertTrue(v.arrayValue().get(0).type() == JsonValueType.OBJECT);
    assertTrue(v.arrayValue().get(1).type() == JsonValueType.OBJECT);
  }
View Full Code Here

Examples of elemental.json.JsonValue

    @Deprecated
    public static JsonObject encodeState(ClientConnector connector, SharedState state) {
        UI uI = connector.getUI();
        ConnectorTracker connectorTracker = uI.getConnectorTracker();
        Class<? extends SharedState> stateType = connector.getStateType();
        JsonValue diffState = connectorTracker.getDiffState(connector);
        boolean supportsDiffState = !JavaScriptConnectorState.class
                .isAssignableFrom(stateType);
        if (diffState == null && supportsDiffState) {
            // Use an empty state object as reference for full
            // repaints
View Full Code Here

Examples of elemental.json.JsonValue

    public JsonValue getDiff() {
        return diff;
    }

    public JsonValue getDiffOrValue() {
        JsonValue diff = getDiff();
        if (diff != null) {
            return diff;
        } else {
            return getEncodedValue();
        }
View Full Code Here

Examples of elemental.json.JsonValue

                invocationJson.set(1, invocation.getInterfaceName());
                invocationJson.set(2, invocation.getMethodName());
                JsonArray paramJson = Json.createArray();
                for (int i = 0; i < invocation.getParameterTypes().length; ++i) {
                    Type parameterType = invocation.getParameterTypes()[i];
                    JsonValue referenceParameter = null;
                    // TODO Use default values for RPC parameter types
                    // if (!JsonCodec.isInternalType(parameterType)) {
                    // try {
                    // referenceParameter = parameterType.newInstance();
                    // } catch (Exception e) {
View Full Code Here

Examples of elemental.json.JsonValue

        s2.caption = "State 2";
        s2.id = "bar";
        stringToStateMap.put("string - state 1", s);
        stringToStateMap.put("String - state 2", s2);

        JsonValue encodedMap = JsonCodec.encode(stringToStateMap, null, mapType,
                null).getEncodedValue();

        ensureDecodedCorrectly(stringToStateMap, encodedMap, mapType);
    }
View Full Code Here

Examples of elemental.json.JsonValue

        s.caption = "State 1";
        s2.caption = "State 2";
        stateToStringMap.put(s, "string - state 1");
        stateToStringMap.put(s2, "String - state 2");

        JsonValue encodedMap = JsonCodec.encode(stateToStringMap, null, mapType,
                null).getEncodedValue();

        ensureDecodedCorrectly(stateToStringMap, encodedMap, mapType);
    }
View Full Code Here

Examples of javax.json.JsonValue

                String.format(
                    "'%s' is absent in JSON: %s", name, json
                )
            );
        }
        final JsonValue value = json.get(name);
        if (value == null) {
            throw new IllegalStateException(
                String.format(
                    "'%s' is NULL in %s", name, json
                )
            );
        }
        if (value.getClass().isAssignableFrom(type)) {
            throw new IllegalStateException(
                String.format(
                    "'%s' is not of type %s", name, type
                )
            );
View Full Code Here

Examples of javax.json.JsonValue

     * @throws IOException If there is any I/O problem
     */
    public boolean hasNotNull(
        @NotNull(message = "name can't be NULL") final String name
    ) throws IOException {
        final JsonValue value = this.object.json().get(name);
        return value != null
            && !ValueType.NULL.equals(value.getValueType());
    }
View Full Code Here

Examples of org.apache.jena.atlas.json.JsonValue

            args = new String[] {"-"} ;

        try {
            for ( String fn : args )
            {
                JsonValue json =null ;
                try {
                 json = JSON.readAny(fn) ;
                } catch (JsonParseException ex)
                {
                    String name = fn.equals("-") ? "<stdin>" : fn ;
View Full Code Here

Examples of org.codehaus.jackson.annotate.JsonValue

        /* Can't use "findUniqueMethodWith" because annotation can be
         * disabled...
         */
        AnnotatedMethod found = null;
        for (AnnotatedMethod am : _classInfo.getMemberMethods()) {
            JsonValue ann = am.getAnnotation(JsonValue.class);
            if (ann == null || !ann.value()) { // ignore if disabled
                continue;
            }
            if (found != null) {
                throw new IllegalArgumentException("Multiple methods with active @JsonValue annotation ("+found.getName()+"(), "+am.getName()+")");
            }
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.