@NotThreadSafe public class CSSValue extends Object implements ICSSValue
ICSSProperty)
and it's according value plus the important state (!important or
not). The main purpose of this class to make building a CSS from scratch
simpler. When an existing CSS is read the information resides in a
CSSDeclaration because it contains the
declaration value in a more structured form.| Constructor and Description |
|---|
CSSValue(ICSSProperty aProperty,
String sValue,
boolean bIsImportant)
Constructor
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
String |
getAsCSSString(ICSSWriterSettings aSettings,
int nIndentLevel)
Get the contents of this object as a serialized CSS string for writing to
an output.
|
ECSSProperty |
getProp() |
ICSSProperty |
getProperty() |
String |
getPropertyName() |
String |
getValue() |
int |
hashCode() |
boolean |
isImportant() |
CSSValue |
setImportant(boolean bIsImportant)
Set the important flag of this value.
|
CSSValue |
setProperty(ICSSProperty aProperty)
Set the property of this CSS value (e.g.
|
CSSValue |
setValue(String sValue)
Set the value of this CSS value (e.g.
|
String |
toString() |
public CSSValue(@Nonnull ICSSProperty aProperty, @Nonnull String sValue, boolean bIsImportant)
aProperty - The CSS property. May not be null.sValue - The String value to use. May be null. The value may
NOT contain the !important flag! The
value is internally trimmed to avoid leading and trailing.bIsImportant - true if the value should be important,
false otherwise@Nonnull public ICSSProperty getProperty()
null.@Nonnull public ECSSProperty getProp()
@Nonnull @Nonempty public String getPropertyName()
null nor empty.@Nonnull public CSSValue setProperty(@Nonnull ICSSProperty aProperty)
background-color).aProperty - The CSS property to set. May not be null.@Nonnull public String getValue()
null but maybe empty.@Nonnull public CSSValue setValue(@Nonnull String sValue)
red in case the property
is background-color).sValue - The value to be set. May not be null. The value may
NOT contain the !important flag! The
value is internally trimmed to avoid leading and trailing.public boolean isImportant()
true if it is important, false if not@Nonnull public CSSValue setImportant(boolean bIsImportant)
bIsImportant - true to mark it important, false to remove
it.@Nonnull public String getAsCSSString(@Nonnull ICSSWriterSettings aSettings, @Nonnegative int nIndentLevel)
ICSSWriteablegetAsCSSString in interface ICSSWriteableaSettings - The settings to be used to format the output. May not be
null.nIndentLevel - The current indentation levelCopyright © 2014–2016 Philip Helger. All rights reserved.