Package com.google.gwt.core.ext

Examples of com.google.gwt.core.ext.UnableToCompleteException


                logger.log(Type.ERROR,
                        "JSNI invocation is not yet supported for methods with "
                                + "primitive return types. Change your method "
                                + "to public to be able to use conventional"
                                + " Java invoking instead.");
                throw new UnableToCompleteException();
            }
        }

        JType[] parameterTypes = method.getParameterTypes();
View Full Code Here


            serverConnectorType = typeOracle.getType(ServerConnector.class
                    .getName());
        } catch (NotFoundException e) {
            logger.log(Type.ERROR,
                    "Can't find " + ServerConnector.class.getName());
            throw new UnableToCompleteException();
        }

        JClassType[] types = serverConnectorType.getSubtypes();

        Map<String, JClassType> mappings = new HashMap<String, JClassType>();

        // Keep track of what has happened to avoid logging intermediate state
        Map<JClassType, List<JClassType>> replaced = new HashMap<JClassType, List<JClassType>>();

        for (JClassType type : types) {
            Connect connectAnnotation = type.getAnnotation(Connect.class);
            if (connectAnnotation == null) {
                continue;
            }

            String identifier = connectAnnotation.value().getCanonicalName();

            JClassType previousMapping = mappings.put(identifier, type);
            if (previousMapping != null) {
                // There are multiple mappings, pick the subclass
                JClassType subclass;
                JClassType superclass;
                if (previousMapping.isAssignableFrom(type)) {
                    subclass = type;
                    superclass = previousMapping;
                } else if (type.isAssignableFrom(previousMapping)) {
                    subclass = previousMapping;
                    superclass = type;
                } else {
                    // Neither inherits from the other - this is a conflict
                    logger.log(
                            Type.ERROR,
                            "Conflicting @Connect mappings detected for "
                                    + identifier
                                    + ": "
                                    + type.getQualifiedSourceName()
                                    + " and "
                                    + previousMapping.getQualifiedSourceName()
                                    + ". There can only be multiple @Connect mappings for the same server-side type if one is the subclass of the other.");
                    throw new UnableToCompleteException();
                }

                mappings.put(identifier, subclass);

                // Inherit any previous replacements
View Full Code Here

        if (type.isGenericType() != null) {
            logger.log(Type.ERROR,
                    "Type " + type.getParameterizedQualifiedSourceName()
                            + "is parameterizied generic. RPC proxy "
                            + "for parameterizied types is not supported.");
            throw new UnableToCompleteException();
        }
    }
View Full Code Here

                            + "."
                            + method.getName()
                            + " returns "
                            + method.getReturnType().getQualifiedSourceName()
                            + " but only void is supported for methods in RPC interfaces.");
            throw new UnableToCompleteException();
        }
    }
View Full Code Here

                                                .getSimpleSourceName()
                                        + ") required by @DelegateToWidget for "
                                        + stateType.getName() + "."
                                        + property.getName()
                                        + " can not be found.");
                        throw new UnableToCompleteException();
                    }
                    bundle.setNeedsInvoker(widgetType, delegatedSetter);

                    // GWT code needs widget type to find the target method
                    bundle.setNeedsReturnType(type, getWidget);
View Full Code Here

                            + ". Communication will work but the Application on server side cannot be serialized if it refers to objects of this type. "
                            + "If the system property "
                            + FAIL_IF_NOT_SERIALIZABLE
                            + " is set to \"true\", this causes the compilation to fail instead of just emitting a warning.");
            if (abortCompile) {
                throw new UnableToCompleteException();
            }
        }
    }
View Full Code Here

            logger.log(
                    TreeLogger.ERROR, "Type '"
                    + requestedType.getQualifiedSourceName() +
                    "' does not implement Exportable", null
            );
            throw new UnableToCompleteException();
        }

        // get the name of the Java class implementing Exporter
        String genName = requestedType.getExporterImplementationName();




        sw.indent();

        // export constructor
        sw.println("private " + ExportableTypeOracle.JSO_CLASS + " jso;");
        sw.println();
        sw.println("public "+genName+"() {}");

        sw.println(
                "public " + genName + "(" + ExportableTypeOracle.JSO_CLASS +
                        " jso) {"
        );
        sw.indent();
        sw.println("this.jso = jso;");
        sw.outdent();
        sw.println("}");
        sw.println();

        // export static factory method
        sw.println(
                "public static " + genName + " makeClosure(" +
                        ExportableTypeOracle.JSO_CLASS + " closure) {"
        );
        sw.indent();
        sw.println("return new " + genName + "(closure);");
        sw.outdent();
        sw.println("}");
        sw.println();

        JExportableMethod[] methods = requestedType.getExportableMethods();

        if (methods.length != 1) {
            logger.log(
                    TreeLogger.ERROR, "Interface " +
                    requestedType.getQualifiedSourceName() +
                    " has more than one " +
                    "declared method. @gwt.exportClosure only currently works for " +
                    "single method interfaces.", null
            );
            throw new UnableToCompleteException();
        }

        JExportableMethod method = methods[0];
        JExportableType retType = method.getExportableReturnType();
        if (retType == null) {
            logger.log(
                    TreeLogger.ERROR,
                    "Return type of method " + method + " is not exportable.",
                    null
            );
            throw new UnableToCompleteException();
        }

        if (retType.needsExport() &&
                !exported.contains(retType.getQualifiedSourceName())) {
            if(exportDependentClass(retType.getQualifiedSourceName()))
View Full Code Here

        if (requestedType == null) {
            logger.log(
                    TreeLogger.ERROR, "Type '"
                    + requestedClass + "' does not implement Exportable", null
            );
            throw new UnableToCompleteException();
        }

        // get the name of the Java class implementing Exporter
        String genName = requestedType.getExporterImplementationName();
View Full Code Here

                                "." +
                                "Two constructors may not have identical numbers of " +
                                "arguments.",
                        null
                );
                throw new UnableToCompleteException();
            }
            arity.put(numArguments, constructor);
            sw.println("else if(arguments.length == " + numArguments + ") {");
            sw.indent();
View Full Code Here

        if (retType == null) {
            logger.log(
                    TreeLogger.ERROR, "Return type of method " +
                    method.toString() + " is not Exportable.", null
            );
            throw new UnableToCompleteException();
        }

        int arity = method.getExportableParameters().length;
        String name = method.getUnqualifiedExportName();
        String key = name + "_" + arity;

        JExportableMethod conflicting = visited.get(key);

        if (conflicting != null) {
            logger.log(
                    TreeLogger.ERROR, "Method " + method + " having " + arity +
                    " arguments conflicts with " + conflicting + ". " +
                    "Two exportable methods cannot have the same number of arguments. " +
                    "Use @gwt.export <newName> on one of the methods to disambiguate.",
                    null
            );
            throw new UnableToCompleteException();
        } else {
            visited.put(key, method);
        }

        // return type needs to be exported if it is not a primitive
View Full Code Here

TOP

Related Classes of com.google.gwt.core.ext.UnableToCompleteException

Copyright © 2018 www.massapicom. 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.