Package com.google.gwt.core.ext

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


      logger.log(TreeLogger.DEBUG, "Reading user-provided manifest", null);
      in = userManifest.getContents(logger);
      if (in == null) {
        logger.log(TreeLogger.ERROR,
            "Unable to read contents of user manifest", null);
        throw new UnableToCompleteException();
      }

    } else {
      // Fall back to the built-in manifest
      String packagePath = getClass().getPackage().getName().replace('.', '/');
      String resourceName = packagePath + "/" + GEARS_MANIFEST;
      in = getClass().getClassLoader().getResourceAsStream(resourceName);
      if (in == null) {
        logger.log(TreeLogger.ERROR, "Could not load built-in manifest from "
            + resourceName, null);
        throw new UnableToCompleteException();
      }
    }

    StringBuffer out = new StringBuffer();
    BufferedReader reader = new BufferedReader(new InputStreamReader(in));
    try {
      for (String line = reader.readLine(); line != null; line = reader.readLine()) {
        out.append(line).append("\n");
      }
    } catch (IOException e) {
      logger.log(TreeLogger.ERROR, "Unable to read manifest template", e);
      throw new UnableToCompleteException();
    }

    return out;
  }
View Full Code Here


  }

  private void logError(TreeLogger logger) throws UnableToCompleteException {
    logger.branch(TreeLogger.ERROR, "Arrays are not supported by the import"
        + " facility unless Java arrays can be subclassed.  Use JSList.", null);
    throw new UnableToCompleteException();
  }
View Full Code Here

      FragmentGenerator fragmentGenerator = fgo.findFragmentGenerator(logger,
          context.typeOracle, returnType);
      if (fragmentGenerator == null) {
        logger.log(TreeLogger.ERROR, "No fragment generator for "
            + returnType.getQualifiedSourceName(), null);
        throw new UnableToCompleteException();
      }

      fragmentGenerator.fromJS(subParams);

      if (i < parameters.length - 1) {
View Full Code Here

  void fromJS(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    context.parentLogger.branch(TreeLogger.ERROR,
        "JavaScript functions may not be imported via JSFunction.", null);

    throw new UnableToCompleteException();
  }
View Full Code Here

    JClassType functionClass = context.returnType.isClassOrInterface();

    if (functionClass.equals(typeOracle.findType(JSFunction.class.getName()))) {
      logger.log(TreeLogger.ERROR, "You must use a subinterface of JSFunction"
          + " so that the generator can extract a method signature.", null);
      throw new UnableToCompleteException();
    }

    // This is to support the JSFunction having the same lifetime as the
    // JSFunction object without having to use GWT.create on every JSFunction
    // object as that would discourage anonymous classes.
View Full Code Here

  @Override
  void writeExtractorJSNIReference(FragmentGeneratorContext context)
      throws UnableToCompleteException {
    context.parentLogger.branch(TreeLogger.ERROR,
        "JSFunctions should never need extraction", null);
    throw new UnableToCompleteException();
  }
View Full Code Here

    JMethod[] methods = clazz.getMethods();
    if (methods.length == 0) {
      logger.log(TreeLogger.ERROR, "The JSFunction interface did not "
          + "declare any functions.", null);
      throw new UnableToCompleteException();
    } else if (methods.length == 1) {
      return methods[0];
    }

    try {
      JMethod toReturn = null;
      for (JMethod method : methods) {
        if (JSWrapperGenerator.hasTag(logger, method, Exported.class) != null) {
          if (toReturn == null) {
            toReturn = method;
          } else {
            // Can't declare two methods with export annotations
            throw new UnableToCompleteException();
          }
        }
      }
      if (toReturn != null) {
        return toReturn;
      } else {
        // Didn't find any methods with an export annotation
        throw new UnableToCompleteException();
      }
    } catch (UnableToCompleteException e) {
      logger.log(TreeLogger.ERROR, "JSFunctions with multiple methods must "
          + " specify exactly one method with an " + Exported.class.getName()
          + " annotation.", null);
View Full Code Here

        // We could not make a decision on what should be done with the method.
      } else {
        logger.log(TreeLogger.ERROR, "Could not decide on implementation of "
            + m.getName(), null);
        throw new UnableToCompleteException();
      }
    }

    return propertyAccessors;
  }
View Full Code Here

        manifest.append(line).append("\n");
      }
      in.close();
    } catch (IOException e) {
      logger.log(TreeLogger.ERROR, "Unable to read manifest stub", e);
      throw new UnableToCompleteException();
    }

    replaceAll(manifest, "__BOOTSTRAP__", bootstrap);

    return emitString(logger, manifest.toString(),
View Full Code Here

    if (findConstructor(context.typeOracle, context.returnType) == null) {
      context.parentLogger.log(TreeLogger.ERROR, "The type "
          + context.returnType.getQualifiedSourceName() + " must possess a "
          + JSFlyweightWrapperGenerator.CREATE_PEER
          + " method to be used as a return type.", null);
      throw new UnableToCompleteException();
    }
    SourceWriter sw = context.sw;

    sw.print("@");
    sw.print(context.returnType.getQualifiedSourceName());
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.