Package org.xhtmlrenderer.css.constants
Class ValueConstants
- java.lang.Object
-
- org.xhtmlrenderer.css.constants.ValueConstants
-
public final class ValueConstants extends java.lang.Object
Utility class for working withCSSValue
instances.- Author:
- empty
-
-
Constructor Summary
Constructors Constructor Description ValueConstants()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static java.lang.String
cssType(int cssType, int primitiveValueType)
A text representation of the CSS type for this value.static java.lang.String
getCssValueTypeDesc(org.w3c.dom.css.CSSValue cssValue)
Gets the cssValueTypeDesc attribute of theCSSValue
objectstatic short
guessType(java.lang.String value)
Incomplete routine to try and determine the CSSPrimitiveValue short code for a given value, e.g.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
isAbsoluteUnit(org.w3c.dom.css.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.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
sacPrimitiveTypeForString(java.lang.String type)
Description of the Methodstatic java.lang.String
stringForSACPrimitiveType(short type)
Description of the Method
-
-
-
Method Detail
-
cssType
public static java.lang.String cssType(int cssType, int primitiveValueType)
A text representation of the CSS type for this value.- Parameters:
cssType
- PARAMprimitiveValueType
- PARAM- Returns:
- Returns
-
sacPrimitiveTypeForString
public static short sacPrimitiveTypeForString(java.lang.String type)
Description of the Method- Parameters:
type
- PARAM- Returns:
- Returns
-
stringForSACPrimitiveType
public static java.lang.String stringForSACPrimitiveType(short type)
Description of the Method- Parameters:
type
- PARAM- Returns:
- Returns
-
isAbsoluteUnit
public static boolean isAbsoluteUnit(org.w3c.dom.css.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.- Returns:
- See desc.
-
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.
-
getCssValueTypeDesc
public static java.lang.String getCssValueTypeDesc(org.w3c.dom.css.CSSValue cssValue)
Gets the cssValueTypeDesc attribute of theCSSValue
object- Parameters:
cssValue
- PARAM- Returns:
- The cssValueTypeDesc value
-
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.
-
guessType
public static short guessType(java.lang.String value)
Incomplete routine to try and determine the CSSPrimitiveValue short code for a given value, e.g. 14pt is CSS_PT.- Parameters:
value
- PARAM- Returns:
- Returns
-
-