Class IdentValue

java.lang.Object
org.xhtmlrenderer.css.constants.IdentValue
All Implemented Interfaces:
FSDerivedValue

public class IdentValue extends Object implements 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 Details

    • ALL_IDENT_VALUES

      private static final Map<String,IdentValue> ALL_IDENT_VALUES
    • maxAssigned

      private static int maxAssigned
    • ident

      private final String ident
    • FS_ID

      public final int FS_ID
    • ABSOLUTE

      public static final IdentValue ABSOLUTE
    • ALWAYS

      public static final IdentValue ALWAYS
    • ARMENIAN

      public static final IdentValue ARMENIAN
    • AUTO

      public static final IdentValue AUTO
    • AVOID

      public static final IdentValue AVOID
    • BASELINE

      public static final IdentValue BASELINE
    • BLOCK

      public static final IdentValue BLOCK
    • BOLD

      public static final IdentValue BOLD
    • BOLDER

      public static final IdentValue BOLDER
    • BORDER_BOX

      public static final IdentValue BORDER_BOX
    • BOTH

      public static final IdentValue BOTH
    • BOTTOM

      public static final IdentValue BOTTOM
    • CAPITALIZE

      public static final IdentValue CAPITALIZE
    • CENTER

      public static final IdentValue CENTER
    • CIRCLE

      public static final IdentValue CIRCLE
    • CJK_IDEOGRAPHIC

      public static final IdentValue CJK_IDEOGRAPHIC
    • CLOSE_QUOTE

      public static final IdentValue CLOSE_QUOTE
    • COLLAPSE

      public static final IdentValue COLLAPSE
    • COMPACT

      public static final IdentValue COMPACT
    • CONTAIN

      public static final IdentValue CONTAIN
    • CONTENT_BOX

      public static final IdentValue CONTENT_BOX
    • COVER

      public static final IdentValue COVER
    • CREATE

      public static final IdentValue CREATE
    • DASHED

      public static final IdentValue DASHED
    • DECIMAL

      public static final IdentValue DECIMAL
    • DECIMAL_LEADING_ZERO

      public static final IdentValue DECIMAL_LEADING_ZERO
    • DISC

      public static final IdentValue DISC
    • DOTTED

      public static final IdentValue DOTTED
    • DOUBLE

      public static final IdentValue DOUBLE
    • DYNAMIC

      public static final IdentValue DYNAMIC
    • FIXED

      public static final IdentValue FIXED
    • FONT_WEIGHT_100

      public static final IdentValue FONT_WEIGHT_100
    • FONT_WEIGHT_200

      public static final IdentValue FONT_WEIGHT_200
    • FONT_WEIGHT_300

      public static final IdentValue FONT_WEIGHT_300
    • FONT_WEIGHT_400

      public static final IdentValue FONT_WEIGHT_400
    • FONT_WEIGHT_500

      public static final IdentValue FONT_WEIGHT_500
    • FONT_WEIGHT_600

      public static final IdentValue FONT_WEIGHT_600
    • FONT_WEIGHT_700

      public static final IdentValue FONT_WEIGHT_700
    • FONT_WEIGHT_800

      public static final IdentValue FONT_WEIGHT_800
    • FONT_WEIGHT_900

      public static final IdentValue FONT_WEIGHT_900
    • FS_CONTENT_PLACEHOLDER

      public static final IdentValue FS_CONTENT_PLACEHOLDER
    • FS_INITIAL_VALUE

      public static final IdentValue FS_INITIAL_VALUE
    • GEORGIAN

      public static final IdentValue GEORGIAN
    • GROOVE

      public static final IdentValue GROOVE
    • HEBREW

      public static final IdentValue HEBREW
    • HIDDEN

      public static final IdentValue HIDDEN
    • HIDE

      public static final IdentValue HIDE
    • HIRAGANA

      public static final IdentValue HIRAGANA
    • HIRAGANA_IROHA

      public static final IdentValue HIRAGANA_IROHA
    • INHERIT

      public static final IdentValue INHERIT
    • INLINE

      public static final IdentValue INLINE
    • INLINE_BLOCK

      public static final IdentValue INLINE_BLOCK
    • INLINE_TABLE

      public static final IdentValue INLINE_TABLE
    • INSET

      public static final IdentValue INSET
    • INSIDE

      public static final IdentValue INSIDE
    • ITALIC

      public static final IdentValue ITALIC
    • JUSTIFY

      public static final IdentValue JUSTIFY
    • KATAKANA

      public static final IdentValue KATAKANA
    • KATAKANA_IROHA

      public static final IdentValue KATAKANA_IROHA
    • KEEP

      public static final IdentValue KEEP
    • LANDSCAPE

      public static final IdentValue LANDSCAPE
    • LEFT

      public static final IdentValue LEFT
    • LIGHTER

      public static final IdentValue LIGHTER
    • LINE

      public static final IdentValue LINE
    • LINE_THROUGH

      public static final IdentValue LINE_THROUGH
    • LIST_ITEM

      public static final IdentValue LIST_ITEM
    • LOWER_ALPHA

      public static final IdentValue LOWER_ALPHA
    • LOWER_GREEK

      public static final IdentValue LOWER_GREEK
    • LOWER_LATIN

      public static final IdentValue LOWER_LATIN
    • LOWER_ROMAN

      public static final IdentValue LOWER_ROMAN
    • LOWERCASE

      public static final IdentValue LOWERCASE
    • LTR

      public static final IdentValue LTR
    • MARKER

      public static final IdentValue MARKER
    • MIDDLE

      public static final IdentValue MIDDLE
    • NO_CLOSE_QUOTE

      public static final IdentValue NO_CLOSE_QUOTE
    • NO_OPEN_QUOTE

      public static final IdentValue NO_OPEN_QUOTE
    • NO_REPEAT

      public static final IdentValue NO_REPEAT
    • NONE

      public static final IdentValue NONE
    • NORMAL

      public static final IdentValue NORMAL
    • NOWRAP

      public static final IdentValue NOWRAP
    • BREAK_WORD

      public static final IdentValue BREAK_WORD
    • OBLIQUE

      public static final IdentValue OBLIQUE
    • OPEN_QUOTE

      public static final IdentValue OPEN_QUOTE
    • OUTSET

      public static final IdentValue OUTSET
    • OUTSIDE

      public static final IdentValue OUTSIDE
    • OVERLINE

      public static final IdentValue OVERLINE
    • PAGINATE

      public static final IdentValue PAGINATE
    • POINTER

      public static final IdentValue POINTER
    • PORTRAIT

      public static final IdentValue PORTRAIT
    • PRE

      public static final IdentValue PRE
    • PRE_LINE

      public static final IdentValue PRE_LINE
    • PRE_WRAP

      public static final IdentValue PRE_WRAP
    • RELATIVE

      public static final IdentValue RELATIVE
    • REPEAT

      public static final IdentValue REPEAT
    • REPEAT_X

      public static final IdentValue REPEAT_X
    • REPEAT_Y

      public static final IdentValue REPEAT_Y
    • RIDGE

      public static final IdentValue RIDGE
    • RUN_IN

      public static final IdentValue RUN_IN
    • SCROLL

      public static final IdentValue SCROLL
    • SEPARATE

      public static final IdentValue SEPARATE
    • SHOW

      public static final IdentValue SHOW
    • SMALL_CAPS

      public static final IdentValue SMALL_CAPS
    • SOLID

      public static final IdentValue SOLID
    • SQUARE

      public static final IdentValue SQUARE
    • STATIC

      public static final IdentValue STATIC
    • SUB

      public static final IdentValue SUB
    • SUPER

      public static final IdentValue SUPER
    • TABLE

      public static final IdentValue TABLE
    • TABLE_CAPTION

      public static final IdentValue TABLE_CAPTION
    • TABLE_CELL

      public static final IdentValue TABLE_CELL
    • TABLE_COLUMN

      public static final IdentValue TABLE_COLUMN
    • TABLE_COLUMN_GROUP

      public static final IdentValue TABLE_COLUMN_GROUP
    • TABLE_HEADER_GROUP

      public static final IdentValue TABLE_HEADER_GROUP
    • TABLE_ROW

      public static final IdentValue TABLE_ROW
    • TABLE_ROW_GROUP

      public static final IdentValue TABLE_ROW_GROUP
    • TEXT_BOTTOM

      public static final IdentValue TEXT_BOTTOM
    • TEXT_TOP

      public static final IdentValue TEXT_TOP
    • THICK

      public static final IdentValue THICK
    • THIN

      public static final IdentValue THIN
    • TOP

      public static final IdentValue TOP
    • TRANSPARENT

      public static final IdentValue TRANSPARENT
    • UNDERLINE

      public static final IdentValue UNDERLINE
    • UPPER_ALPHA

      public static final IdentValue UPPER_ALPHA
    • UPPER_LATIN

      public static final IdentValue UPPER_LATIN
    • UPPER_ROMAN

      public static final IdentValue UPPER_ROMAN
    • UPPERCASE

      public static final IdentValue UPPERCASE
    • VISIBLE

      public static final IdentValue VISIBLE
    • CROSSHAIR

      public static final IdentValue CROSSHAIR
    • DEFAULT

      public static final IdentValue DEFAULT
    • EMBED

      public static final IdentValue EMBED
    • E_RESIZE

      public static final IdentValue E_RESIZE
    • HELP

      public static final IdentValue HELP
    • LARGE

      public static final IdentValue LARGE
    • LARGER

      public static final IdentValue LARGER
    • MEDIUM

      public static final IdentValue MEDIUM
    • MOVE

      public static final IdentValue MOVE
    • N_RESIZE

      public static final IdentValue N_RESIZE
    • NE_RESIZE

      public static final IdentValue NE_RESIZE
    • NW_RESIZE

      public static final IdentValue NW_RESIZE
    • PROGRESS

      public static final IdentValue PROGRESS
    • S_RESIZE

      public static final IdentValue S_RESIZE
    • SE_RESIZE

      public static final IdentValue SE_RESIZE
    • SMALL

      public static final IdentValue SMALL
    • SMALLER

      public static final IdentValue SMALLER
    • START

      public static final IdentValue START
    • SW_RESIZE

      public static final IdentValue SW_RESIZE
    • TEXT

      public static final IdentValue TEXT
    • W_RESIZE

      public static final IdentValue W_RESIZE
    • WAIT

      public static final IdentValue WAIT
    • X_LARGE

      public static final IdentValue X_LARGE
    • X_SMALL

      public static final IdentValue X_SMALL
    • XX_LARGE

      public static final IdentValue XX_LARGE
    • XX_SMALL

      public static final IdentValue XX_SMALL
    • MANUAL

      public static final IdentValue MANUAL
  • Constructor Details

    • IdentValue

      private IdentValue(String ident)
  • Method Details

    • toString

      public String toString()
      Returns a string representation of the object, in this case, the ident as a string (as it appears in the CSS spec).
      Overrides:
      toString in class Object
      Returns:
      a string representation of the object.
    • getByIdentString

      public static IdentValue getByIdentString(String ident)
      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

      public static boolean looksLikeIdent(String ident)
    • valueOf

      public static IdentValue valueOf(String ident)
    • getIdentCount

      public static int getIdentCount()
    • addValue

      private static IdentValue addValue(String ident)
      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:
      isDeclaredInherit in interface FSDerivedValue
    • computedValue

      public FSDerivedValue computedValue()
    • asFloat

      public float asFloat()
      Specified by:
      asFloat in interface FSDerivedValue
    • asColor

      public FSColor asColor()
      Specified by:
      asColor in interface FSDerivedValue
    • getFloatProportionalTo

      public float getFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx)
      Specified by:
      getFloatProportionalTo in interface FSDerivedValue
    • asString

      public String asString()
      Specified by:
      asString in interface FSDerivedValue
    • asStringArray

      public String[] asStringArray()
      Specified by:
      asStringArray in interface FSDerivedValue
    • asIdentValue

      public IdentValue asIdentValue()
      Specified by:
      asIdentValue in interface FSDerivedValue
    • hasAbsoluteUnit

      public boolean hasAbsoluteUnit()
      Specified by:
      hasAbsoluteUnit in interface FSDerivedValue
    • isIdent

      public boolean isIdent()
      Specified by:
      isIdent in interface FSDerivedValue
    • isDependentOnFontSize

      public boolean isDependentOnFontSize()
      Specified by:
      isDependentOnFontSize in interface FSDerivedValue