Class GssFunctions

java.lang.Object
com.google.common.css.compiler.gssfunctions.GssFunctions

public class GssFunctions extends Object
Container for common GSS functions.
  • Field Details

  • Constructor Details

    • GssFunctions

      public GssFunctions()
  • Method Details

    • getFunctionMap

      public static Map<String,GssFunction> getFunctionMap()
      Returns:
      a map from each GSS function name to the function
    • parseBoolean

      public static boolean parseBoolean(String numericPart)
      Helper method to convert a numeric value of "0" or "1" into a boolean.
      Parameters:
      numericPart - The string containing the value
      Returns:
      The corresponding boolean value
    • createUrlNode

      public static CssFunctionNode createUrlNode(String imageUrl, SourceCodeLocation location)
      Helper method for implementors of GssFunction to allow the creation of a url entry node in a GSS file.
      Parameters:
      imageUrl - The url of the image to add.
      location - The location in the GSS file to place the node.
      Returns:
      The node containing the url entry.
    • assertArgumentLooksLikeAColor

      public static void assertArgumentLooksLikeAColor(int argOrdinal, CssValueNode argValue, ErrorManager errorManager) throws GssFunctionException
      Verify a function argument looks like a color node.
      Throws:
      GssFunctionException
    • error

      public static GssFunctionException error(CssValueNode node, String errorMessage, ErrorManager errorManager)
    • createUrl

      public static String createUrl(String url)
      Helper method for implementors of GssFunction to allow the creation of a url string in the GSS.
      Parameters:
      url - The url of the image to add.
      Returns:
      The proper GSS url string.