Top Description Fields Constructors Methods
com.openhtmltopdf.css.constants

public final Class ValueConstants

extends Object
Class Inheritance
Imports
com.openhtmltopdf.css.parser.CSSPrimitiveValue, com.openhtmltopdf.util.LogMessageId, .XRLog, java.util.*, java.util.logging.Level

Utility class for working with CSSValue instances.

Field Summary

Modifier and TypeField and Description
private static final Map<Short, String>

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static boolean

Returns:

See desc.
isAbsoluteUnit
(short
The CSSValue type to check.
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).

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.

public static String
stringForSACPrimitiveType(short type)

Given a unit constant like CSSPrimitiveValue.CSS_EMS will return the unit suffix like em.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sacTypesStringsback to summary
private static final Map<Short, String> sacTypesStrings

Constructor Detail

ValueConstantsback to summary
public ValueConstants()

Method Detail

isAbsoluteUnitback to summary
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:short

The CSSValue type to check.

Returns:boolean

See desc.

isNumberback to summary
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)?

Annotations
@Deprecated
stringForSACPrimitiveTypeback to summary
public static String stringForSACPrimitiveType(short type)

Given a unit constant like CSSPrimitiveValue.CSS_EMS will return the unit suffix like em. FIXME: Not exhaustive.