Package com.google.gwt.core.ext

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


    if (f == null) {
      context.parentLogger.log(TreeLogger.ERROR, "The type or a supertype of "
          + context.returnType.getQualifiedSourceName() + " must possess a "
          + JSWrapperGenerator.OBJ + " field to be used as a parameter type.",
          null);
      throw new UnableToCompleteException();
    }
    SourceWriter sw = context.sw;
    sw.print(".@");
    sw.print(f.getEnclosingType().getQualifiedSourceName());
    sw.print("::");
View Full Code Here


    if (f == null) {
      context.parentLogger.log(TreeLogger.ERROR, "The type or a supertype of "
          + context.returnType.getQualifiedSourceName() + " must possess a "
          + JSWrapperGenerator.EXTRACTOR + " field to be used with a JSList",
          null);
      throw new UnableToCompleteException();
    }

    SourceWriter sw = context.sw;

    sw.print("@");
View Full Code Here

    } else if (isAssignable(typeOracle, returnType, Number.class)) {
      return "0";
    }

    throw new UnableToCompleteException();
  }
View Full Code Here

      sw.print("(S)(");

    } else {
      logger.log(TreeLogger.ERROR, "Unknown boxed type "
          + returnType.getQualifiedSourceName(), null);
      throw new UnableToCompleteException();
    }

    sw.print(context.parameterName);
    sw.print(")");
  }
View Full Code Here

      }

      if (annotationDefaultValue == null && metaData.length == 0) {
        logger.log(TreeLogger.ERROR, "Metadata " + tagName
            + " must appear exactly once", null);
        throw new UnableToCompleteException();

      } else if (returnType.equals(String.class)) {
        if (metaData[0].length == 1) {
          logger.log(TreeLogger.TRACE, "Using value from metadata", null);
          value = metaData[0][0];

        } else if (annotationDefaultValue != null) {
          value = annotationDefaultValue;
        } else {
          logger.log(TreeLogger.ERROR, "Metadata " + tagName
              + " must have exactly one value", null);
          throw new UnableToCompleteException();
        }

      } else if (annotationDefaultValue != null) {
        logger.log(TreeLogger.TRACE, "Using annotation's default value", null);
        value = annotationDefaultValue;

      } else {
        logger.log(TreeLogger.ERROR, "Can't deal with return type "
            + returnType.getName(), null);
        throw new UnableToCompleteException();
      }
    } catch (NoSuchMethodException e) {
      // Just a tag annotation
      value = null;
    }
View Full Code Here

    final JClassType sourceType = typeOracle.findType(typeName);

    // Ensure that the requested type exists
    if (sourceType == null) {
      logger.log(TreeLogger.ERROR, "Could not find requested typeName", null);
      throw new UnableToCompleteException();
    }

    // Pick a name for the generated class to not conflict. Enclosing class
    // names must be preserved.
    final String generatedSimpleSourceName = "__"
        + sourceType.getName().replaceAll("\\.", "__") + "Impl";

    // Begin writing the generated source.
    final ClassSourceFileComposerFactory f = new ClassSourceFileComposerFactory(
        sourceType.getPackage().getName(), generatedSimpleSourceName);

    // Pull in source imports
    f.addImport(GWT.class.getName());
    f.addImport(JavaScriptObject.class.getName());
    // This is a cheat, but doesn't require excessive maintenance
    f.addImport("com.google.gwt.jsio.client.*");
    f.addImport("com.google.gwt.jsio.client.impl.*");

    // Either extend an abstract base class or implement the interface
    if (sourceType.isClass() != null) {
      f.setSuperclass(sourceType.getQualifiedSourceName());

    } else if (sourceType.isInterface() != null) {
      f.addImplementedInterface(sourceType.getQualifiedSourceName());

    } else {
      // Something is very wrong if this statement is reached
      logger.log(TreeLogger.ERROR,
          "Requested JClassType is neither a class nor an interface.", null);
      throw new UnableToCompleteException();
    }

    // All source gets written through this Writer
    final PrintWriter out = context.tryCreate(logger,
        sourceType.getPackage().getName(), generatedSimpleSourceName);
View Full Code Here

    for (Task pair : propertyAccessors.values()) {
      error |= pair.validate(this, context);
    }

    if (error) {
      throw new UnableToCompleteException();
    }
  }
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) {
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) {
View Full Code Here

    JType parameterType = context.returnType;

    FragmentGenerator fragmentGenerator = FRAGMENT_ORACLE.findFragmentGenerator(
        logger, typeOracle, context.returnType);
    if (fragmentGenerator == null) {
      throw new UnableToCompleteException();
    }

    // Ensure that there will be no angle-bracket in the output
    JParameterizedType pType = parameterType.isParameterized();
    if (pType != null) {
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.