Class ValueConstants

java.lang.Object
org.xhtmlrenderer.css.constants.ValueConstants

public final class ValueConstants extends Object
Utility class for working with CSSValue instances.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static String
    cssType(int cssType, int primitiveValueType)
    A text representation of the CSS type for this value.
    static String
    Gets the cssValueTypeDesc attribute of the CSSValue object
    static short
    guessType(@Nullable String value)
    Incomplete routine to try and determine the CSSPrimitiveValue short code for a given value, e.g. 14pt is CSS_PT.
    static boolean
    isAbsoluteUnit(short type)
    Returns true if the specified type absolute (even if we have a computed value for it), meaning that either the value can be used directly (e.g.
    static boolean
    Returns true if the specified value was absolute (even if we have a computed value for it), meaning that either the value can be used directly (e.g. pixels) or there is a fixed context-independent conversion for it (e.g. inches).
    static boolean
    isNumber(short cssPrimitiveType)
    Returns true if the SAC primitive value type is a number unit--a unit that can only contain a numeric value.
    static short
     
    static String
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ValueConstants

      public ValueConstants()
  • Method Details

    • cssType

      public static String cssType(int cssType, int primitiveValueType)
      A text representation of the CSS type for this value.
    • sacPrimitiveTypeForString

      public static short sacPrimitiveTypeForString(@Nullable String type)
    • stringForSACPrimitiveType

      public static String stringForSACPrimitiveType(short type)
    • isAbsoluteUnit

      public static boolean isAbsoluteUnit(CSSPrimitiveValue primitive)
      Returns true if the specified value was absolute (even if we have a computed value for it), meaning that either the value can be used directly (e.g. pixels) or there is a fixed context-independent conversion for it (e.g. inches). Proportional types (e.g. %) return false.
      Parameters:
      primitive - The CSSValue instance to check.
    • isAbsoluteUnit

      public static boolean isAbsoluteUnit(short type)
      Returns true if the specified type absolute (even if we have a computed value for it), meaning that either the value can be used directly (e.g. pixels) or there is a fixed context-independent conversion for it (e.g. inches). Proportional types (e.g. %) return false.
      Parameters:
      type - The CSSValue type to check.
    • getCssValueTypeDesc

      public static String getCssValueTypeDesc(CSSValue cssValue)
      Gets the cssValueTypeDesc attribute of the CSSValue object
    • isNumber

      public static boolean isNumber(short cssPrimitiveType)
      Returns true if the SAC primitive value type is a number unit--a unit that can only contain a numeric value. This is a shorthand way of saying, did the user declare this as a number unit (like px)?
    • guessType

      public static short guessType(@Nullable String value)
      Incomplete routine to try and determine the CSSPrimitiveValue short code for a given value, e.g. 14pt is CSS_PT.