- All Superinterfaces:
Cloneable
- All Known Subinterfaces:
CSSColorMixFunction,CSSColorValue,CSSCountersValue,CSSCounterValue,CSSEnvVariableValue,CSSExpressionValue,CSSFunctionValue,CSSGradientValue,CSSLexicalValue,CSSMathFunctionValue,CSSMathValue,CSSNumberValue,CSSPrimitiveValue,CSSRatioValue,CSSShorthandValue,CSSTransformFunction,CSSTypedValue,CSSUnicodeRangeValue,CSSUnicodeRangeValue.CSSUnicodeValue,CSSValueList<E>,CSSVarValue,HSLColorValue,HWBColorValue,LABColorValue,LCHColorValue
- All Known Implementing Classes:
CalcValue,ColorValue,EnvVariableValue,ExpressionValue,FunctionValue,GradientValue,HSLColorValue,HWBColorValue,IdentifierValue,InheritValue,InitialValue,KeywordValue,LABColorValue,LCHColorValue,LexicalValue,LinkedCSSValueList,MathFunctionValue,NumberValue,PercentageValue,PrimitiveValue,ProxyValue,RatioValue,RectValue,RevertValue,RGBColorValue,StringValue,StyleValue,SystemDefaultValue,TransformFunction,TypedValue,UnicodeRangeValue,UnicodeValue,UnicodeWildcardValue,UnknownValue,UnsetValue,URIValue,URIValueWrapper,ValueList
A CSS style value.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enumThe main categories of values.static enumThe type of value. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates and returns a copy of this value.Get a parsable representation of this value.Get the general category to which this value belongs.default StringGives a minified version of the css text of the property.default StringgetMinifiedCssText(String propertyName) Gives a minified version of the css text of the property.default StringListGet the list of preceding comments.Get the primitive type.default StringListGet the list of trailing comments.default booleanmatches(CSSValueSyntax syntax) Verify if this value matches the given grammar.voidsetCssText(String cssText) Set this value according to the given parsable text.voidwriteCssText(SimpleWriter wri) Serialize this value to aSimpleWriter.
-
Method Details
-
getCssValueType
CSSValue.CssType getCssValueType()Get the general category to which this value belongs.- Returns:
- the general value type.
-
getPrimitiveType
CSSValue.Type getPrimitiveType()Get the primitive type.- Returns:
- the primitive type.
-
isPrimitiveValue
default boolean isPrimitiveValue()- Returns:
trueif the value isTYPEDorPROXY.
-
getCssText
String getCssText()Get a parsable representation of this value.- Returns:
- the CSS serialization of this value.
-
setCssText
Set this value according to the given parsable text.- Parameters:
cssText- the text value.- Throws:
DOMException- INVALID_MODIFICATION_ERR if the text value represents a different type or the value cannot be modified.
INVALID_CHARACTER_ERR if an invalid character was found.
SYNTAX_ERR if the string is invalid CSS.
-
clone
CSSValue clone()Creates and returns a copy of this value.- Returns:
- a clone of this value.
-
getMinifiedCssText
Gives a minified version of the css text of the property.- Returns:
- the minified css text.
-
getMinifiedCssText
Gives a minified version of the css text of the property.It may be customized for the given property name.
- Parameters:
propertyName- the property name.- Returns:
- the minified css text.
-
writeCssText
Serialize this value to aSimpleWriter.- Parameters:
wri- the SimpleWriter.- Throws:
IOException- if an error happened while writing.
-
getPrecedingComments
Get the list of preceding comments.- Returns:
- the list of preceding comments, or
nullif none.
-
getTrailingComments
Get the list of trailing comments.- Returns:
- the list of trailing comments, or
nullif none.
-
matches
Verify if this value matches the given grammar.See also:
SyntaxParser.- Parameters:
syntax- the syntax.- Returns:
- the matching for the syntax.
-