Class ValueConstants

java.lang.Object
com.openhtmltopdf.css.constants.ValueConstants

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

    Constructors
    Constructor Description
    ValueConstants()  
  • Method Summary

    Modifier and Type Method Description
    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 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 String stringForSACPrimitiveType​(short type)
    Description of the Method

    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

    • stringForSACPrimitiveType

      public static String stringForSACPrimitiveType​(short type)
      Description of the Method
      Parameters:
      type - PARAM
      Returns:
      Returns
    • 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.
      Returns:
      See desc.
    • 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)?
      Parameters:
      cssPrimitiveType - PARAM
      Returns:
      See desc.