Class ValueConstants


  • public final class ValueConstants
    extends java.lang.Object
    Utility class for working with CSSValue instances.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private static java.util.Map<java.lang.Short,​java.lang.String> sacTypesStrings  
    • Constructor Summary

      Constructors 
      Constructor Description
      ValueConstants()  
    • Method Summary

      All Methods Static Methods Concrete Methods Deprecated Methods 
      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)
      Deprecated.
      Only used by the broken DOMInspector.
      static java.lang.String stringForSACPrimitiveType​(short type)
      Given a unit constant like CSSPrimitiveValue.CSS_EMS will return the unit suffix like em.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • sacTypesStrings

        private static final java.util.Map<java.lang.Short,​java.lang.String> sacTypesStrings
    • Constructor Detail

      • ValueConstants

        public ValueConstants()
    • Method Detail

      • stringForSACPrimitiveType

        public static java.lang.String stringForSACPrimitiveType​(short type)
        Given a unit constant like CSSPrimitiveValue.CSS_EMS will return the unit suffix like em. FIXME: Not exhaustive.
      • 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. FIXME: Font proportional units are returned as absolute. Probably wrong method name rather than wrong behavior.
        Parameters:
        type - The CSSValue type to check.
        Returns:
        See desc.
      • isNumber

        @Deprecated
        public static boolean isNumber​(short cssPrimitiveType)
        Deprecated.
        Only used by the broken DOMInspector.
        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)?