Package com.google.gwt.core.ext

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


        ResourceGeneratorUtil.findResources(logger, context, method);

    if (resources.length != 1) {
      logger.log(TreeLogger.ERROR, "Exactly one "
          + ResourceGeneratorUtil.METADATA_TAG + " must be specified", null);
      throw new UnableToCompleteException();
    }

    URL resource = resources[0];

    SourceWriter sw = context.getSourceWriter();
View Full Code Here


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

      return extractFieldName(logger, imported, true);
    } else if (constructor != null) {
      return extractFieldName(logger, constructor, true);
    } else {
      logger.log(TreeLogger.ERROR, "Unable to determine field name", null);
      throw new UnableToCompleteException();
    }
  }
View Full Code Here

          Field f = NamePolicy.class.getDeclaredField(policyName.toUpperCase());
          policy = (NamePolicy) f.get(null);

        } catch (IllegalAccessException e) {
          logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, e);
          throw new UnableToCompleteException();

        } catch (NoSuchFieldException e) {
          // This means that the value specified is not a field, but likely
          // a class name. Try instantiating one and seeing if it's a
          // subclass of NamePolicy.
          try {
            Class<? extends NamePolicy> clazz = Class.forName(policyName).asSubclass(
                NamePolicy.class);
            policy = clazz.newInstance();
          } catch (ClassCastException ee) {
            logger.log(TreeLogger.ERROR,
                "@gwt.namePolicy is not an implementation of NamePolicy", null);
            throw new UnableToCompleteException();
          } catch (ClassNotFoundException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          } catch (IllegalAccessException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          } catch (InstantiationException ee) {
            logger.log(TreeLogger.ERROR, "Bad gwt.namePolicy " + policyName, ee);
            throw new UnableToCompleteException();
          }
        }
      }

      // Execute the conversion
View Full Code Here

    JParameter[] paramList = method.getParameters();
    if (paramList.length == 0) {
      context.parentLogger.branch(TreeLogger.ERROR,
          "No parameters specified for method " + method.getName()
              + "().  (First parameter must be a JavaScriptObject.)", null);
      throw new UnableToCompleteException();
    }
    JParameter param = method.getParameters()[0];
    JClassType paramType = param.getType().isClassOrInterface();
    JField f;

    if (context.typeOracle.findType(JavaScriptObject.class.getName()).equals(
        paramType)) {
      context.objRef = param.getName();

    } else if ((f = PeeringFragmentGenerator.findPeer(context.typeOracle,
        paramType)) != null) {
      context.objRef = param.getName() + ".@"
          + f.getEnclosingType().getQualifiedSourceName() + "::" + f.getName();

    } else {
      context.parentLogger.branch(TreeLogger.ERROR,
          "Invalid first parameter type for flyweight imported function. "
              + "It is not a JavaScriptObject and it lacks a jsoPeer field.",
          null);
      throw new UnableToCompleteException();
    }
  }
View Full Code Here

      // Use the binding type specified in the the gwt.binding annotation.
      bindingType = typeOracle.findType(bindingAnnotation.value());
      if (bindingType == null) {
        logger.log(TreeLogger.ERROR, "Could not resolve binding type "
            + bindingType, null);
        throw new UnableToCompleteException();
      }
    }

    sw.println(") {");
    sw.indent();
View Full Code Here

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

        fragmentGenerator.toJS(subParams);

        if (i < parameters.length - 1) {
          sw.print(", ");
        }
      }
      sw.print(")");

    } else if (globalAnnotation != null) {
      sw.print(globalAnnotation.value());

    } else {
      logger.log(TreeLogger.ERROR,
          "Writing a constructor, but no constructor-appropriate annotations",
          null);
      throw new UnableToCompleteException();
    }
    sw.println(";");

    writeEmptyFieldInitializers(subContext);
View Full Code Here

      setObjRef(context, imported);
    } else {
      context.parentLogger.branch(TreeLogger.ERROR,
          "Imported methods in a flyweight interface must have a leading "
              + "JavaScriptObject parameter", null);
      throw new UnableToCompleteException();
    }

    super.writeImported(context, imported);
  }
View Full Code Here

        filterError = true;
      }
    }

    if (filterError) {
      throw new UnableToCompleteException();
    }

    return filters;
  }
View Full Code Here

          digester.update(buffer, 0, read);
        }
      } catch (IOException e) {
        logger.log(TreeLogger.ERROR, "Unable to read artifact "
            + artifact.getPartialPath(), e);
        throw new UnableToCompleteException();
      }
    }

    // Add an alias for Module.nocache.js?compiled to support hosted-mode
    entries.append(",\n{ \"url\" : \"" + context.getModuleName()
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.