- All Implemented Interfaces:
Serializable
,Comparable<CSSValue.Type>
,java.lang.constant.Constable
- Enclosing interface:
CSSValue
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum ConstantDescriptionattr()
function.Color.Color-Mix function.CSScounter()
function.CSScounters()
function.cubic-bezier()
easing function.Element reference.Environment variable.An expression with algebraic syntax (i.e.Function.Gradient function.Identifier.inherit
keyword.initial
keyword.For this library's internal use.Invalid (non-primitive and non-keyword) value.Lexical value.Mathematical function (as defined by CSS Values and Units).Numeric type (excludescalc()
which is anEXPRESSION
).Ratio value.rect()
function.revert
keyword.steps()
easing function.String.Unicode character.Unicode range.Unicode wildcard.Unknown type, probably a system default or a compat value.unset
keyword.URI (url()
).Custom property reference. -
Method Summary
Modifier and TypeMethodDescriptionstatic CSSValue.Type
Returns the enum constant of this class with the specified name.static CSSValue.Type[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
UNKNOWN
Unknown type, probably a system default or a compat value. -
INHERIT
inherit
keyword. -
INITIAL
initial
keyword. -
UNSET
unset
keyword. -
REVERT
revert
keyword. -
NUMERIC
Numeric type (excludescalc()
which is anEXPRESSION
).Casting to
CSSTypedValue
orTypedValue
should give you what you need (like the numeric value viagetFloatValue
). If it does not, please look atNumberValue
. -
STRING
String.Casting to
CSSTypedValue
orTypedValue
will give you access to the string value viagetStringValue()
. -
IDENT
Identifier.Casting to
CSSTypedValue
orTypedValue
will give you access to the identifier value viagetStringValue()
. -
COLOR
Color.Casting to
CSSColorValue
orColorValue
provides methods likegetColorModel()
orgetColor()
(the latter provides the actual color as aCSSColor
).Once you retrieve the color, you can then use the indexed component access in
CSSColor.item(int)
, or cast it to a model sub-interface (likeRGBAColor
) according to the result ofgetColorModel()
. SeeColorModel
for details. -
COLOR_MIX
Color-Mix function.Cast to
CSSColorMixFunction
.getColor()
provides the interpolated color as aCSSColor
.Once you retrieve the color, you can then use the indexed component access in
CSSColor.item(int)
, or cast it to a model sub-interface (likeRGBAColor
) according to the result ofgetColorModel()
. SeeColorModel
for details. -
URI
URI (url()
).Casting to
CSSTypedValue
orTypedValue
will give you access to the URL value as a string, viagetStringValue()
and is probably all that you need.You could also cast to
URIValue
, which gives you a couple of convenience methods likeisEquivalent
orgetURLValue()
. -
RECT
rect()
function.Cast to
CSSRectValue
orRectValue
. -
EXPRESSION
An expression with algebraic syntax (i.e.calc()
).See
CSSExpressionValue
. -
GRADIENT
Gradient function.Cast to
CSSGradientValue
. -
COUNTER
CSScounter()
function.See
CSSCounterValue
. -
COUNTERS
CSScounters()
function.See
CSSCountersValue
. -
CUBIC_BEZIER
cubic-bezier()
easing function.Cast to
CSSFunctionValue
. -
STEPS
steps()
easing function.Cast to
CSSFunctionValue
. -
FUNCTION
Function.Cast to
CSSFunctionValue
orFunctionValue
.Note: on functions,
CSSTypedValue.getStringValue()
must return the function name. -
MATH_FUNCTION
Mathematical function (as defined by CSS Values and Units).Cast to
CSSMathFunctionValue
.Note: on functions,
CSSTypedValue.getStringValue()
must return the function name. -
UNICODE_RANGE
Unicode range. SeeCSSUnicodeRangeValue
. -
UNICODE_CHARACTER
Unicode character. SeeCSSUnicodeRangeValue.CSSUnicodeValue
. -
UNICODE_WILDCARD
Unicode wildcard. SeeCSSUnicodeRangeValue
. -
ELEMENT_REFERENCE
Element reference.Casting to
CSSTypedValue
orTypedValue
will give you access to the reference value viaCSSTypedValue.getStringValue()
. -
RATIO
Ratio value.Cast to
CSSRatioValue
orRatioValue
. -
ATTR
attr()
function.Cast to
CSSAttrValue
orAttrValue
. -
VAR
Custom property reference.Cast to
CSSVarValue
orVarValue
. -
ENV
Environment variable. SeeCSSEnvVariableValue
. -
LEXICAL
Lexical value.Cast to
CSSLexicalValue
orLexicalValue
. -
INTERNAL
For this library's internal use. -
INVALID
Invalid (non-primitive and non-keyword) value.The value is either a list or a shorthand.
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-