org.xhtmlrenderer.css.constants
Class IdentValue

java.lang.Object
  extended by 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 == .

Author:
Patrick Wright

Field Summary
static IdentValue ABSOLUTE
           
static IdentValue ALWAYS
           
static IdentValue ARMENIAN
           
static IdentValue AUTO
           
static IdentValue AVOID
           
static IdentValue BASELINE
           
static IdentValue BLINK
           
static IdentValue BLOCK
           
static IdentValue BOLD
           
static IdentValue BOLDER
           
static IdentValue BOTH
           
static IdentValue BOTTOM
           
static IdentValue BREAK_WORD
           
static IdentValue CAPITALIZE
           
static IdentValue CENTER
           
static IdentValue CIRCLE
           
static IdentValue CJK_IDEOGRAPHIC
           
static IdentValue CLOSE_QUOTE
           
static IdentValue COLLAPSE
           
static IdentValue COMPACT
           
static IdentValue CONTAIN
           
static IdentValue COVER
           
static IdentValue CROSSHAIR
           
static IdentValue DASHED
           
static IdentValue DECIMAL
           
static IdentValue DECIMAL_LEADING_ZERO
           
static IdentValue DEFAULT
           
static IdentValue DISC
           
static IdentValue DOTTED
           
static IdentValue DOUBLE
           
static IdentValue E_RESIZE
           
static IdentValue EMBED
           
static IdentValue FIXED
           
static IdentValue FONT_WEIGHT_100
           
static IdentValue FONT_WEIGHT_200
           
static IdentValue FONT_WEIGHT_300
           
static IdentValue FONT_WEIGHT_400
           
static IdentValue FONT_WEIGHT_500
           
static IdentValue FONT_WEIGHT_600
           
static IdentValue FONT_WEIGHT_700
           
static IdentValue FONT_WEIGHT_800
           
static IdentValue FONT_WEIGHT_900
           
static IdentValue FS_CONTENT_PLACEHOLDER
           
 int FS_ID
           
static IdentValue FS_INITIAL_VALUE
           
static IdentValue GEORGIAN
           
static IdentValue GROOVE
           
static IdentValue HEBREW
           
static IdentValue HELP
           
static IdentValue HIDDEN
           
static IdentValue HIDE
           
static IdentValue HIRAGANA
           
static IdentValue HIRAGANA_IROHA
           
static IdentValue INHERIT
           
static IdentValue INLINE
           
static IdentValue INLINE_BLOCK
           
static IdentValue INLINE_TABLE
           
static IdentValue INSET
           
static IdentValue INSIDE
           
static IdentValue ITALIC
           
static IdentValue JUSTIFY
           
static IdentValue KATAKANA
           
static IdentValue KATAKANA_IROHA
           
static IdentValue KEEP
           
static IdentValue LANDSCAPE
           
static IdentValue LARGE
           
static IdentValue LARGER
           
static IdentValue LEFT
           
static IdentValue LIGHTER
           
static IdentValue LINE
           
static IdentValue LINE_THROUGH
           
static IdentValue LIST_ITEM
           
static IdentValue LOWER_ALPHA
           
static IdentValue LOWER_GREEK
           
static IdentValue LOWER_LATIN
           
static IdentValue LOWER_ROMAN
           
static IdentValue LOWERCASE
           
static IdentValue LTR
           
static IdentValue MARKER
           
static IdentValue MEDIUM
           
static IdentValue MIDDLE
           
static IdentValue MOVE
           
static IdentValue N_RESIZE
           
static IdentValue NE_RESIZE
           
static IdentValue NO_CLOSE_QUOTE
           
static IdentValue NO_OPEN_QUOTE
           
static IdentValue NO_REPEAT
           
static IdentValue NONE
           
static IdentValue NORMAL
           
static IdentValue NOWRAP
           
static IdentValue NW_RESIZE
           
static IdentValue OBLIQUE
           
static IdentValue OPEN_QUOTE
           
static IdentValue OUTSET
           
static IdentValue OUTSIDE
           
static IdentValue OVERLINE
           
static IdentValue PAGINATE
           
static IdentValue POINTER
           
static IdentValue PORTRAIT
           
static IdentValue PRE
           
static IdentValue PRE_LINE
           
static IdentValue PRE_WRAP
           
static IdentValue PROGRESS
           
static IdentValue RELATIVE
           
static IdentValue REPEAT
           
static IdentValue REPEAT_X
           
static IdentValue REPEAT_Y
           
static IdentValue RIDGE
           
static IdentValue RIGHT
           
static IdentValue RUN_IN
           
static IdentValue S_RESIZE
           
static IdentValue SCROLL
           
static IdentValue SE_RESIZE
           
static IdentValue SEPARATE
           
static IdentValue SHOW
           
static IdentValue SMALL
           
static IdentValue SMALL_CAPS
           
static IdentValue SMALLER
           
static IdentValue SOLID
           
static IdentValue SQUARE
           
static IdentValue START
           
static IdentValue STATIC
           
static IdentValue SUB
           
static IdentValue SUPER
           
static IdentValue SW_RESIZE
           
static IdentValue TABLE
           
static IdentValue TABLE_CAPTION
           
static IdentValue TABLE_CELL
           
static IdentValue TABLE_COLUMN
           
static IdentValue TABLE_COLUMN_GROUP
           
static IdentValue TABLE_FOOTER_GROUP
           
static IdentValue TABLE_HEADER_GROUP
           
static IdentValue TABLE_ROW
           
static IdentValue TABLE_ROW_GROUP
           
static IdentValue TEXT
           
static IdentValue TEXT_BOTTOM
           
static IdentValue TEXT_TOP
           
static IdentValue THICK
           
static IdentValue THIN
           
static IdentValue TOP
           
static IdentValue TRANSPARENT
           
static IdentValue UNDERLINE
           
static IdentValue UPPER_ALPHA
           
static IdentValue UPPER_LATIN
           
static IdentValue UPPER_ROMAN
           
static IdentValue UPPERCASE
           
static IdentValue VISIBLE
           
static IdentValue W_RESIZE
           
static IdentValue WAIT
           
static IdentValue X_LARGE
           
static IdentValue X_SMALL
           
static IdentValue XX_LARGE
           
static IdentValue XX_SMALL
           
 
Method Summary
 FSColor asColor()
           
 float asFloat()
           
 IdentValue asIdentValue()
           
 String asString()
           
 String[] asStringArray()
           
 FSDerivedValue computedValue()
           
static IdentValue getByIdentString(String ident)
          Returns the Singleton IdentValue that corresponds to the given string, e.g.
 float getFloatProportionalTo(CSSName cssName, float baseValue, CssContext ctx)
           
static int getIdentCount()
           
 boolean hasAbsoluteUnit()
           
 boolean isDeclaredInherit()
           
 boolean isDependentOnFontSize()
           
 boolean isIdent()
           
static boolean looksLikeIdent(String ident)
          TODO: doc
 String toString()
          Returns a string representation of the object, in this case, the ident as a string (as it appears in the CSS spec).
static IdentValue valueOf(String ident)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

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

BLINK

public static final IdentValue BLINK

BLOCK

public static final IdentValue BLOCK

BOLD

public static final IdentValue BOLD

BOLDER

public static final IdentValue BOLDER

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

COVER

public static final IdentValue COVER

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

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

RIGHT

public static final IdentValue RIGHT

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_FOOTER_GROUP

public static final IdentValue TABLE_FOOTER_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
Method Detail

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.
Returns:
see desc.

looksLikeIdent

public static boolean looksLikeIdent(String ident)
TODO: doc


valueOf

public static IdentValue valueOf(String ident)

getIdentCount

public static int getIdentCount()

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


Copyright © 2013. All Rights Reserved.