Examples of CssCompilerException


Examples of com.google.gwt.libideas.resources.css.ast.CssCompilerException

        } catch (NoSuchMethodException e) {
          // OK
        }

      } catch (SecurityException e) {
        throw new CssCompilerException(
            "Unable to invoke property handler function for " + name, e);
      } catch (IllegalArgumentException e) {
        throw new CssCompilerException(
            "Unable to invoke property handler function for " + name, e);
      } catch (IllegalAccessException e) {
        throw new CssCompilerException(
            "Unable to invoke property handler function for " + name, e);
      } catch (InvocationTargetException e) {
        throw new CssCompilerException(
            "Unable to invoke property handler function for " + name, e);
      }
    }
View Full Code Here

Examples of com.google.gwt.libideas.resources.css.ast.CssCompilerException

      if (functionName == null) {
        logger.log(TreeLogger.ERROR, "The @sprite rule " + x.getSelectors()
            + " must specify the " + CssSprite.IMAGE_PROPERTY_NAME
            + " property");
        throw new CssCompilerException("No image property specified");
      }

      // Find the image accessor method
      JMethod imageMethod = null;
      JMethod[] allMethods = bundleType.getOverridableMethods();
      for (int i = 0; imageMethod == null && i < allMethods.length; i++) {
        JMethod candidate = allMethods[i];
        // If the function name matches and takes no parameters
        if (candidate.getName().equals(functionName)
            && candidate.getParameters().length == 0) {
          // We have a match
          imageMethod = candidate;
        }
      }

      // Method unable to be located
      if (imageMethod == null) {
        logger.log(TreeLogger.ERROR, "Unable to find ImageResource method "
            + functionName + " in " + bundleType.getQualifiedSourceName());
        throw new CssCompilerException("Cannot find image function");
      }

      JClassType imageResourceType = context.getGeneratorContext().getTypeOracle().findType(
          ImageResource.class.getName());
      assert imageResourceType != null;

      if (!imageResourceType.isAssignableFrom(imageMethod.getReturnType().isClassOrInterface())) {
        logger.log(TreeLogger.ERROR, "The return type of " + functionName
            + " is not assignable to "
            + imageResourceType.getSimpleSourceName());
        throw new CssCompilerException("Incorrect return type for "
            + CssSprite.IMAGE_PROPERTY_NAME + " method");
      }

      ImageOptions options = imageMethod.getAnnotation(ImageOptions.class);
      RepeatStyle repeatStyle;
View Full Code Here

Examples of com.google.gwt.libideas.resources.css.ast.CssCompilerException

          if (method == null) {
            logger.log(TreeLogger.ERROR, "Unable to find DataResource method "
                + functionName + " in "
                + context.getResourceBundleType().getQualifiedSourceName());
            throw new CssCompilerException("Cannot find data function");
          }

          String instance = "((" + DataResource.class.getName() + ")("
              + context.getImplementationSimpleSourceName() + ".this."
              + functionName + "()))";
View Full Code Here

Examples of com.google.gwt.libideas.resources.css.ast.CssCompilerException

          errorLogger.log(TreeLogger.ERROR, s);
        }
      }

      if (stop) {
        throw new CssCompilerException("Missing a CSS replacement");
      }
    }
View Full Code Here

Examples of com.google.gwt.libideas.resources.css.ast.CssCompilerException

          // Always delete @if rules that we can statically evaluate
          ctx.removeMe();
        } catch (BadPropertyValueException e) {
          logger.log(TreeLogger.ERROR, "Unable to evaluate @if block", e);
          throw new CssCompilerException("Unable to parse CSS", e);
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.libideas.resources.css.ast.CssCompilerException

        try {
          requirements.addPermutationAxis(propertyName);
        } catch (BadPropertyValueException e) {
          logger.log(TreeLogger.ERROR, "Unknown deferred-binding property "
              + propertyName, e);
          throw new CssCompilerException("Unknown deferred-binding property", e);
        }
      }
    }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

    DotPathValue functionName = x.getResourceFunction();

    if (functionName == null) {
      logger.log(TreeLogger.ERROR, "The @sprite rule " + x.getSelectors()
          + " must specify the " + CssSprite.IMAGE_PROPERTY_NAME + " property");
      throw new CssCompilerException("No image property specified");
    }

    JClassType imageResourceType = context.getGeneratorContext().getTypeOracle().findType(
        ImageResource.class.getName());
    assert imageResourceType != null;

    // Find the image accessor method
    JMethod imageMethod;
    try {
      imageMethod = ResourceGeneratorUtil.getMethodByPath(bundleType,
          functionName.getParts(), imageResourceType);
    } catch (NotFoundException e) {
      logger.log(TreeLogger.ERROR, "Unable to find ImageResource method "
          + functionName + " in " + bundleType.getQualifiedSourceName() + " : "
          + e.getMessage());
      throw new CssCompilerException("Cannot find image function");
    }

    ImageOptions options = imageMethod.getAnnotation(ImageOptions.class);
    RepeatStyle repeatStyle;
    if (options != null) {
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

      } catch (NoSuchMethodException e) {
        // OK
      }

    } catch (SecurityException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    } catch (IllegalArgumentException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    } catch (IllegalAccessException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    } catch (InvocationTargetException e) {
      throw new CssCompilerException(
          "Unable to invoke property handler function for " + name, e);
    }
  }
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

        try {
          methodType = ResourceGeneratorUtil.getMethodByPath(context.getClientBundleType(),
              functionName.getParts(), null).getReturnType();
        } catch (NotFoundException e) {
          logger.log(TreeLogger.ERROR, e.getMessage());
          throw new CssCompilerException("Cannot find data method");
        }

        if (!(methodType instanceof JClassType) ||
            (!dataResourceType.isAssignableFrom((JClassType) methodType) &&
            !imageResourceType.isAssignableFrom((JClassType) methodType))) {
          String message = "Invalid method type for url substitution: " + methodType + ". " +
              "Only DataResource and ImageResource are supported.";
          logger.log(TreeLogger.ERROR, message);
          throw new CssCompilerException(message);
        }

        StringBuilder expression = new StringBuilder();
        expression.append("\"url('\" + ");
        expression.append(context.getImplementationSimpleSourceName());
View Full Code Here

Examples of com.google.gwt.resources.css.ast.CssCompilerException

        if (!foundMethod) {
          logger.log(TreeLogger.ERROR, "Unable to find DataResource method "
              + functionName + " in "
              + context.getClientBundleType().getQualifiedSourceName());
          throw new CssCompilerException("Cannot find data function");
        }

        String instance = "((" + DataResource.class.getName() + ")("
            + context.getImplementationSimpleSourceName() + ".this."
            + functionName + "()))";
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.