Package org.xhtmlrenderer.css.constants
Class IdentValue
java.lang.Object
org.xhtmlrenderer.css.constants.IdentValue
- All Implemented Interfaces:
FSDerivedValue
An IdentValue represents a string that you can assign to a CSS property,
where the string is one of several enumerated values. For example,
"whitespace" can take the values "nowrap", "pre" and "normal". There is a
static instance for all idents in the CSS 2 spec, which you can retrieve
using the
getByIdentString(String) method. The instance doesn't have
any behavior: it's just a marker so that you can retrieve an ident from a
DerivedValue or CalculatedStyle, then compare to the instance here. For
example:
CalculatedStyle style = ...getstyle from somewhere
IdentValue whitespace = style.getIdent(CSSName.WHITESPACE);
if ( whitespace == IdentValue.NORMAL ) {
// perform normal spacing
} else if ( whitespace == IdentValue.NOWRAP ) {
// space with no wrapping
} else if ( whitespace == IdentValue.PRE ) {
// preserve spacing
}
All static instances are instantiated automatically, and are
Singletons, so you can compare using a simple Object comparison using ==
.-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final IdentValueprivate static final Map<String, IdentValue> static final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuefinal intstatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValueprivate final Stringstatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValueprivate static intstatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValuestatic final IdentValue -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static IdentValueAdds a feature to the Value attribute of the IdentValue classasColor()floatasFloat()asString()String[]static IdentValuegetByIdentString(String ident) Returns the Singleton IdentValue that corresponds to the given string, e.g.floatgetFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx) static intbooleanbooleanbooleanbooleanisIdent()static booleanlooksLikeIdent(String ident) toString()Returns a string representation of the object, in this case, the ident as a string (as it appears in the CSS spec).static @Nullable IdentValue
-
Field Details
-
ALL_IDENT_VALUES
-
maxAssigned
private static int maxAssigned -
ident
-
FS_ID
public final int FS_ID -
ABSOLUTE
-
ALWAYS
-
ARMENIAN
-
AUTO
-
AVOID
-
BASELINE
-
BLINK
-
BLOCK
-
BOLD
-
BOLDER
-
BORDER_BOX
-
BOTH
-
BOTTOM
-
BREAK_ALL
-
CAPITALIZE
-
CENTER
-
CIRCLE
-
CJK_IDEOGRAPHIC
-
CLOSE_QUOTE
-
COLLAPSE
-
COMPACT
-
CONTAIN
-
CONTENT_BOX
-
COVER
-
CREATE
-
DASHED
-
DECIMAL
-
DECIMAL_LEADING_ZERO
-
DISC
-
DOTTED
-
DOUBLE
-
DYNAMIC
-
FIXED
-
FONT_WEIGHT_100
-
FONT_WEIGHT_200
-
FONT_WEIGHT_300
-
FONT_WEIGHT_400
-
FONT_WEIGHT_500
-
FONT_WEIGHT_600
-
FONT_WEIGHT_700
-
FONT_WEIGHT_800
-
FONT_WEIGHT_900
-
FS_CONTENT_PLACEHOLDER
-
FS_INITIAL_VALUE
-
GEORGIAN
-
GROOVE
-
HEBREW
-
HIDDEN
-
HIDE
-
HIRAGANA
-
HIRAGANA_IROHA
-
INHERIT
-
INLINE
-
INLINE_BLOCK
-
INLINE_TABLE
-
INSET
-
INSIDE
-
ITALIC
-
JUSTIFY
-
KATAKANA
-
KATAKANA_IROHA
-
KEEP
-
LANDSCAPE
-
LEFT
-
LIGHTER
-
LINE
-
LINE_THROUGH
-
LIST_ITEM
-
LOWER_ALPHA
-
LOWER_GREEK
-
LOWER_LATIN
-
LOWER_ROMAN
-
LOWERCASE
-
LTR
-
MARKER
-
MIDDLE
-
NO_CLOSE_QUOTE
-
NO_OPEN_QUOTE
-
NO_REPEAT
-
NONE
-
NORMAL
-
NOWRAP
-
BREAK_WORD
-
OBLIQUE
-
OPEN_QUOTE
-
OUTSET
-
OUTSIDE
-
OVERLINE
-
PAGINATE
-
POINTER
-
PORTRAIT
-
PRE
-
PRE_LINE
-
PRE_WRAP
-
RELATIVE
-
REPEAT
-
REPEAT_X
-
REPEAT_Y
-
RIDGE
-
RIGHT
-
RUN_IN
-
SCROLL
-
SEPARATE
-
SHOW
-
SMALL_CAPS
-
SOLID
-
SQUARE
-
STATIC
-
SUB
-
SUPER
-
TABLE
-
TABLE_CAPTION
-
TABLE_CELL
-
TABLE_COLUMN
-
TABLE_COLUMN_GROUP
-
TABLE_FOOTER_GROUP
-
TABLE_HEADER_GROUP
-
TABLE_ROW
-
TABLE_ROW_GROUP
-
TEXT_BOTTOM
-
TEXT_TOP
-
THICK
-
THIN
-
TOP
-
TRANSPARENT
-
UNDERLINE
-
UPPER_ALPHA
-
UPPER_LATIN
-
UPPER_ROMAN
-
UPPERCASE
-
VISIBLE
-
CROSSHAIR
-
DEFAULT
-
EMBED
-
E_RESIZE
-
HELP
-
LARGE
-
LARGER
-
MEDIUM
-
MOVE
-
N_RESIZE
-
NE_RESIZE
-
NW_RESIZE
-
PROGRESS
-
S_RESIZE
-
SE_RESIZE
-
SMALL
-
SMALLER
-
START
-
SW_RESIZE
-
TEXT
-
W_RESIZE
-
WAIT
-
X_LARGE
-
X_SMALL
-
XX_LARGE
-
XX_SMALL
-
MANUAL
-
-
Constructor Details
-
IdentValue
-
-
Method Details
-
toString
Returns a string representation of the object, in this case, the ident as a string (as it appears in the CSS spec). -
getByIdentString
Returns the Singleton IdentValue that corresponds to the given string, e.g. for "normal" will return IdentValue.NORMAL. Use this when you have the string but need to look up the Singleton. If the string doesn't match an ident in the CSS spec, a runtime exception is thrown.- Parameters:
ident- The identifier to retrieve the Singleton IdentValue for.
-
looksLikeIdent
-
valueOf
-
getIdentCount
public static int getIdentCount() -
addValue
Adds a feature to the Value attribute of the IdentValue class- Parameters:
ident- The feature to be added to the Value attribute
-
isDeclaredInherit
public boolean isDeclaredInherit()- Specified by:
isDeclaredInheritin interfaceFSDerivedValue
-
computedValue
-
asFloat
public float asFloat()- Specified by:
asFloatin interfaceFSDerivedValue
-
asColor
- Specified by:
asColorin interfaceFSDerivedValue
-
getFloatProportionalTo
- Specified by:
getFloatProportionalToin interfaceFSDerivedValue
-
asString
- Specified by:
asStringin interfaceFSDerivedValue
-
asStringArray
- Specified by:
asStringArrayin interfaceFSDerivedValue
-
asIdentValue
- Specified by:
asIdentValuein interfaceFSDerivedValue
-
hasAbsoluteUnit
public boolean hasAbsoluteUnit()- Specified by:
hasAbsoluteUnitin interfaceFSDerivedValue
-
isIdent
public boolean isIdent()- Specified by:
isIdentin interfaceFSDerivedValue
-
isDependentOnFontSize
public boolean isDependentOnFontSize()- Specified by:
isDependentOnFontSizein interfaceFSDerivedValue
-