Package com.google.gwt.core.ext

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


      if (binding == null) {
        // This should not happen, but fail with a meaningful message if it
        // does.
        logger.log(TreeLogger.Type.ERROR, "Unable to find a binding for the required key "
            + methodKey);
        throw new UnableToCompleteException();
      }

      if (!reachabilityAnalyzer.isReachable(binding)) {
        // Sanity-check reachability: every binding in the Ginjector ought to be
        // reachable.
        PrettyPrinter.log(logger, TreeLogger.Type.ERROR,
            "The key %s is required by the Ginjector, but is not reachable.", methodKey);
        throw new UnableToCompleteException();
      }

      FragmentPackageName fragmentPackageName = fragmentPackageNameFactory.create(
          binding.getGetterMethodPackage());

      String body = String.format("return %s.%s().%s();",
          ginjectorNameGenerator.getFieldName(bindings),
          nameGenerator.getFragmentGetterMethodName(fragmentPackageName),
          nameGenerator.getGetterMethodName(guiceUtil.getKey(method)));

      String readableDeclaration = ReflectUtil.signatureBuilder(method)
          .removeAbstractModifier()
          .build();
      sourceWriteUtil.writeMethod(writer, readableDeclaration, body.toString());
    }

    // Implements methods of the form "void foo(BarType bar)", which run member
    // injection on the given BarType.
    for (MethodLiteral<?, Method> method : memberInjectCollector.getMethods(ginjectorInterface)) {
      Key<?> injectee = guiceUtil.getKey(method);

      if (!reachabilityAnalyzer.isReachableMemberInject(bindings, injectee.getTypeLiteral())) {
        // Sanity-check reachability: every member injection in the Ginjector
        // ought to be reachable.
        PrettyPrinter.log(logger, TreeLogger.Type.ERROR,
            "Method injection of %s is required by the Ginjector, but is not reachable.",
            injectee.getTypeLiteral());
        throw new UnableToCompleteException();
      }

      FragmentPackageName fragmentPackageName = fragmentPackageNameFactory.create(
          ReflectUtil.getUserPackageName(injectee.getTypeLiteral()));
View Full Code Here


  private String getImplClassName(Class<?> ginjectorInterface) throws UnableToCompleteException {
    try {
      return ReflectUtil.getSourceName(ginjectorInterface).replace(".", "_") + "Impl";
    } catch (NoSourceNameException e) {
      logger.log(TreeLogger.Type.ERROR, "Could not determine source name for ginjector", e);
      throw new UnableToCompleteException();
    }
  }
View Full Code Here

                + " this error, you will need to remove the script tags from the"
                + " gwt.xml file, or add this property to the gwt.xml file:"
                + " <set-configuration-property name='xsiframe.failIfScriptTag' value='FALSE'/>";
        // CHECKSTYLE_ON
        logger.log(TreeLogger.ERROR, msg);
        throw new UnableToCompleteException();
      } else {
        if (logger.isLoggable(TreeLogger.INFO)) {
          logger.log(TreeLogger.INFO, "Ignoring the following script tags in the gwt.xml "
              + "file\n" + list);
        }
View Full Code Here

    if (jsSource.endsWith(".js")) {
      try {
        js = Utility.getFileFromClassPath(jsSource);
      } catch (IOException e) {
        logger.log(TreeLogger.ERROR, "Unable to read file: " + jsSource, e);
        throw new UnableToCompleteException();
      }
    } else {
      js = jsSource;
    }
    replaceAll(selectionScript, templateVar, js);
View Full Code Here

    foundError = true;
  }

  public void checkForError() throws UnableToCompleteException {
    if (foundError) {
      throw new UnableToCompleteException();
    }
  }
View Full Code Here

      throws UnableToCompleteException {
    try {
      return ReflectUtil.getSourceName(ginjectorInterface).replace(".", "_") + "Impl";
    } catch (NoSourceNameException e) {
      logger.log(TreeLogger.Type.ERROR, "Could not determine source name for ginjector", e);
      throw new UnableToCompleteException();
    }
  }
View Full Code Here

  private void validateInjectorClass()
      throws UnableToCompleteException {
    if (!ginjectorInterface.getRawType().isInterface()) {
      logger.log(TreeLogger.ERROR,
          ginjectorInterface.getRawType().getCanonicalName() + " is not an interface", null);
      throw new UnableToCompleteException();
    }
  }
View Full Code Here

    try {
      ginjectorInterface = getGinjectorType(typeName);
    } catch (ClassNotFoundException e) {
      this.logger.log(TreeLogger.ERROR, String.format("Unable to load ginjector type [%s], "
          + "maybe you haven't compiled your client java sources?", typeName), e);
      throw new UnableToCompleteException();
    } catch (IllegalArgumentException e) {
      this.logger.log(TreeLogger.Type.ERROR, e.getMessage(), e);
      throw new UnableToCompleteException();
    }

    // This is the Injector we use for the Generator internally,
    // it has nothing to do with user code.
    Module module = new GinjectorGeneratorModule(logger, context, ginjectorInterface,
View Full Code Here

        // officially illegal to call any GWT-client code in a Gin module.
        Class<?> ginModule = loadClass(moduleName, true);
        if (!GinModule.class.isAssignableFrom(ginModule)) {
          logger.log(TreeLogger.Type.ERROR, String.format("The gin module type [%s] does not "
              + "inherit from GinModule.", moduleName));
          throw new UnableToCompleteException();
        }
        ginModules.add((Class<? extends GinModule>) ginModule);
      } catch (ClassNotFoundException e) {
        logger.log(TreeLogger.ERROR, String.format("Unable to load gin module type [%s], "
            + "maybe you haven't compiled your client java sources?", moduleName), e);
        throw new UnableToCompleteException();
      }
    }
  }
View Full Code Here

    for (String propertyName : propertyNames) {
      Set<String> moduleNames = getValuesForProperty(propertyName);
      if (moduleNames.isEmpty()) {
        logger.log(TreeLogger.Type.ERROR, String.format("The GinModules annotation requests "
            + "property %s, but this property cannot be found in the GWT module.", propertyName));
        throw new UnableToCompleteException();
      }
      configurationModuleNames.addAll(moduleNames);
    }
    return configurationModuleNames;
  }
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.