Package com.openhtmltopdf.css.style
Interface FSDerivedValue
- All Known Implementing Classes:
ColorValue
,CountersValue
,DerivedValue
,FunctionValue
,IdentValue
,LengthValue
,ListValue
,NumberValue
,StringValue
public interface FSDerivedValue
Marker interface for all derived values. All methods for any
possible style are declared here, which doesn't make complete
sense, as, for example, a length can't return a value for asColor().
This is done so that CalculatedStyle can just look up an
FSDerivedValue, without casting, and call the appropriate function
without a cast to the appropriate subtype.
The users of CalculatedStyle have to then make sure they don't
make meaningless calls like asColor(CSSName.HEIGHT). DerivedValue
and IdentValue, the two implementations of this interface, just
throw a RuntimeException if they can't handle the call.
NOTE: When resolving proportional property values, implementations of this
interface must be prepared to handle calls with different base values.
-
Method Summary
Modifier and TypeMethodDescriptionasColor()
float
asFloat()
asString()
String[]
float
getFloatProportionalTo
(CSSName cssName, float baseValue, CssContext ctx) boolean
boolean
boolean
boolean
isIdent()
-
Method Details
-
isDeclaredInherit
boolean isDeclaredInherit() -
asFloat
float asFloat() -
asColor
FSColor asColor() -
getFloatProportionalTo
-
asString
String asString() -
asStringArray
String[] asStringArray() -
asIdentValue
IdentValue asIdentValue() -
hasAbsoluteUnit
boolean hasAbsoluteUnit() -
isDependentOnFontSize
boolean isDependentOnFontSize() -
isIdent
boolean isIdent()
-