Examples of JType


Examples of com.google.gwt.core.ext.typeinfo.JType

        w.println(
                "protected native Object jsniInvoke(Object target, %s<Object> params) /*-{ ",
                JsArrayObject.class.getName());
        w.indent();

        JType returnType = method.getReturnType();
        boolean hasReturnType = !"void".equals(returnType
                .getQualifiedSourceName());

        // Note that void is also a primitive type
        boolean hasPrimitiveReturnType = hasReturnType
                && returnType.isPrimitive() != null;

        if (hasReturnType) {
            w.print("return ");

            if (hasPrimitiveReturnType) {
                // Integer.valueOf(expression);
                w.print("@%s::valueOf(%s)(", returnType.isPrimitive()
                        .getQualifiedBoxedSourceName(), returnType
                        .getJNISignature());

                // Implementation tested briefly, but I don't dare leave it
                // enabled since we are not using it in the framework and we
                // have not tests for it.
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

        w.indent();

        w.println("public Object invoke(Object target, Object[] params) {");
        w.indent();

        JType returnType = method.getReturnType();
        boolean hasReturnType = !"void".equals(returnType
                .getQualifiedSourceName());
        if (hasReturnType) {
            w.print("return ");
        }

        JType[] parameterTypes = method.getParameterTypes();

        w.print("((" + type.getQualifiedSourceName() + ") target)."
                + method.getName() + "(");
        for (int i = 0; i < parameterTypes.length; i++) {
            JType parameterType = parameterTypes[i];
            if (i != 0) {
                w.print(", ");
            }
            String parameterTypeName = getBoxedTypeName(parameterType);
            w.print("(" + parameterTypeName + ") params[" + i + "]");
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

                unboxValue(valueVariable));

    }

    private static String findGetter(JClassType beanType, JMethod setterMethod) {
        JType setterParameterType = setterMethod.getParameterTypes()[0];
        String fieldName = setterMethod.getName().substring(3);
        if (setterParameterType.getQualifiedSourceName().equals(
                boolean.class.getName())) {
            return "is" + fieldName;
        } else {
            return "get" + fieldName;
        }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

                .findInheritedMethod(type, "getState");
        bundle.setNeedsReturnType(type, getState);

        bundle.setNeedsSerialize(getState.getReturnType());

        JType stateType = getState.getReturnType();
        bundle.setNeedsGwtConstructor(stateType.isClass());
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

    }

    @Override
    protected void printDeserializerBody(TreeLogger logger, SourceWriter w,
            String type, String jsonValue, String connection) {
        JType leafType = arrayType.getLeafType();
        int rank = arrayType.getRank();

        w.println(JSONArray.class.getName() + " jsonArray = " + jsonValue
                + ".isArray();");

        // Type value = new Type[jsonArray.size()][][];
        w.print(arrayType.getQualifiedSourceName() + " value = new "
                + leafType.getQualifiedSourceName() + "[jsonArray.size()]");
        for (int i = 1; i < rank; i++) {
            w.print("[]");
        }
        w.println(";");

        w.println("for(int i = 0 ; i < value.length; i++) {");
        w.indent();

        JType componentType = arrayType.getComponentType();

        w.print("value[i] = ("
                + ConnectorBundleLoaderFactory.getBoxedTypeName(componentType)
                + ") " + JsonDecoder.class.getName() + ".decodeValue(");
        ConnectorBundleLoaderFactory.writeTypeCreator(w, componentType);
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

    }

    @Override
    protected void printSerializerBody(TreeLogger logger, SourceWriter w,
            String value, String applicationConnection) {
        JType componentType = arrayType.getComponentType();

        w.println(JSONArray.class.getName() + " values = new "
                + JSONArray.class.getName() + "();");
        // JPrimitiveType primitive = componentType.isPrimitive();
        w.println("for (int i = 0; i < " + value + ".length; i++) {");
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

            JMethod deserializeMethod = serializer.findMethod(
                    deserializeMethodName, deserializeParamTypes);
            if (deserializeMethod == null) {
                continue;
            }
            JType returnType = deserializeMethod.getReturnType();

            serializers.put(returnType, serializer);
        }
        return serializers;
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

    private void purgeSerializeSupportQueue(TreeLogger logger)
            throws UnableToCompleteException {
        while (!needsSerializeSupport.isEmpty()) {
            Iterator<JType> iterator = needsSerializeSupport.iterator();
            JType type = iterator.next();
            iterator.remove();

            if (hasSerializeSupport(type)) {
                continue;
            }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

            setNeedsGwtConstructor(typeAsClass);

            for (Property property : getProperties(typeAsClass)) {
                setNeedsProperty(property);

                JType propertyType = property.getPropertyType();
                setNeedsSerialize(propertyType);
            }
        }
    }
View Full Code Here

Examples of com.google.gwt.core.ext.typeinfo.JType

    public JType getPropertyType() {
        return propertyType;
    }

    public String getUnboxedPropertyTypeName() {
        JType propertyType = getPropertyType();
        JPrimitiveType primitive = propertyType.isPrimitive();
        if (primitive != null) {
            return primitive.getQualifiedBoxedSourceName();
        } else {
            return propertyType.getQualifiedSourceName();
        }
    }
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.