Package com.helger.html.hc.ext
Class HCHasCSSStyles
- java.lang.Object
-
- com.helger.html.hc.ext.HCHasCSSStyles
-
- All Implemented Interfaces:
com.helger.commons.traits.IGenericImplTrait<HCHasCSSStyles>,IHCHasCSSStyles<HCHasCSSStyles>
public class HCHasCSSStyles extends Object implements IHCHasCSSStyles<HCHasCSSStyles>
Stand alone implementation ofIHCHasCSSStyles- Since:
- 4.5.2
- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Constructor Description HCHasCSSStyles()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description HCHasCSSStylesaddStyle(com.helger.css.propertyvalue.ICSSValue aValue)Add an element specific style.booleancontainsStyle(com.helger.css.property.ECSSProperty eProperty)Check if a style value is associated to a single property.com.helger.commons.collection.impl.ICommonsOrderedMap<com.helger.css.property.ECSSProperty,com.helger.css.propertyvalue.ICSSValue>getAllStyles()StringgetAllStylesAsString(com.helger.css.ICSSWriterSettings aCSSSettings)The value to be set to the HTML style attributecom.helger.commons.collection.impl.ICommonsList<com.helger.css.propertyvalue.ICSSValue>getAllStyleValues()com.helger.css.propertyvalue.ICSSValuegetStyleValue(com.helger.css.property.ECSSProperty eProperty)Find the style value associated to a single property.booleanhasAnyStyle()booleanhasStyle(com.helger.css.propertyvalue.ICSSValue aValue)Check if the style property is contained, and the value matches.HCHasCSSStylesremoveAllStyles()Remove all styles from the elementHCHasCSSStylesremoveStyle(com.helger.css.property.ECSSProperty eProperty)Remove the specified style from the elementStringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.html.hc.html.IHCHasCSSStyles
addStyle, addStyles, addStyles, addStyles
-
-
-
-
Method Detail
-
getAllStyles
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsOrderedMap<com.helger.css.property.ECSSProperty,com.helger.css.propertyvalue.ICSSValue> getAllStyles()
- Specified by:
getAllStylesin interfaceIHCHasCSSStyles<HCHasCSSStyles>- Returns:
- A copy of all contained styles. Never
null.
-
getAllStyleValues
@Nonnull @ReturnsMutableCopy public final com.helger.commons.collection.impl.ICommonsList<com.helger.css.propertyvalue.ICSSValue> getAllStyleValues()
- Specified by:
getAllStyleValuesin interfaceIHCHasCSSStyles<HCHasCSSStyles>- Returns:
- All style values. Never
null.
-
getStyleValue
@Nullable public final com.helger.css.propertyvalue.ICSSValue getStyleValue(@Nullable com.helger.css.property.ECSSProperty eProperty)
Description copied from interface:IHCHasCSSStylesFind the style value associated to a single property.- Specified by:
getStyleValuein interfaceIHCHasCSSStyles<HCHasCSSStyles>- Parameters:
eProperty- The property to search. May benull.- Returns:
nullif no such style is contained.
-
containsStyle
public final boolean containsStyle(@Nullable com.helger.css.property.ECSSProperty eProperty)
Description copied from interface:IHCHasCSSStylesCheck if a style value is associated to a single property.- Specified by:
containsStylein interfaceIHCHasCSSStyles<HCHasCSSStyles>- Parameters:
eProperty- The property to search. May benull.- Returns:
trueif a respective style is present,falseotherwise.
-
hasStyle
public final boolean hasStyle(@Nullable com.helger.css.propertyvalue.ICSSValue aValue)
Description copied from interface:IHCHasCSSStylesCheck if the style property is contained, and the value matches.- Specified by:
hasStylein interfaceIHCHasCSSStyles<HCHasCSSStyles>- Parameters:
aValue- The value to be checked- Returns:
trueif such a CSS value is contained,falseotherwise
-
hasAnyStyle
public final boolean hasAnyStyle()
- Specified by:
hasAnyStylein interfaceIHCHasCSSStyles<HCHasCSSStyles>- Returns:
trueif at least one CSS style is assigned,falseotherwise.
-
addStyle
@Nonnull public final HCHasCSSStyles addStyle(@Nullable com.helger.css.propertyvalue.ICSSValue aValue)
Description copied from interface:IHCHasCSSStylesAdd an element specific style.- Specified by:
addStylein interfaceIHCHasCSSStyles<HCHasCSSStyles>- Parameters:
aValue- The value to be added. May benull.- Returns:
- this
-
removeStyle
@Nonnull public final HCHasCSSStyles removeStyle(@Nonnull com.helger.css.property.ECSSProperty eProperty)
Description copied from interface:IHCHasCSSStylesRemove the specified style from the element- Specified by:
removeStylein interfaceIHCHasCSSStyles<HCHasCSSStyles>- Parameters:
eProperty- The style property to remove- Returns:
- this
-
removeAllStyles
@Nonnull public final HCHasCSSStyles removeAllStyles()
Description copied from interface:IHCHasCSSStylesRemove all styles from the element- Specified by:
removeAllStylesin interfaceIHCHasCSSStyles<HCHasCSSStyles>- Returns:
- this
-
getAllStylesAsString
@Nullable public final String getAllStylesAsString(@Nonnull com.helger.css.ICSSWriterSettings aCSSSettings)
Description copied from interface:IHCHasCSSStylesThe value to be set to the HTML style attribute- Specified by:
getAllStylesAsStringin interfaceIHCHasCSSStyles<HCHasCSSStyles>- Parameters:
aCSSSettings- The CSS settings to use- Returns:
nullif no styles are present
-
-