Package com.google.gwt.libideas.resources.css.ast

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


      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

          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

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

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

          // 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

        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

TOP

Related Classes of com.google.gwt.libideas.resources.css.ast.CssCompilerException

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.