IMPLTYPE - Implementation typepublic interface IHasCSSDeclarations<IMPLTYPE extends IHasCSSDeclarations<IMPLTYPE>> extends ICSSWriteable, com.helger.commons.traits.IGenericImplTrait<IMPLTYPE>
| Modifier and Type | Method and Description |
|---|---|
IMPLTYPE |
addDeclaration(CSSDeclaration aDeclaration)
Add a new declaration.
|
IMPLTYPE |
addDeclaration(int nIndex,
CSSDeclaration aDeclaration)
Add a new declaration at the specified index.
|
default IMPLTYPE |
addDeclaration(String sProperty,
CSSExpression aExpression,
boolean bImportant)
Add a new declaration.
|
com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> |
getAllDeclarations() |
com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> |
getAllDeclarationsOfPropertyName(String sPropertyName)
Get all declarations within this list that have the specified property
name.
|
default com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> |
getAllDeclarationsOfPropertyNameCaseInsensitive(String sPropertyName)
Deprecated.
Since 6.0.0 - use
getAllDeclarationsOfPropertyName(String) instead. |
CSSDeclaration |
getDeclarationAtIndex(int nIndex) |
int |
getDeclarationCount() |
CSSDeclaration |
getDeclarationOfPropertyName(String sPropertyName)
Get the first declaration with the specified property name.
|
default CSSDeclaration |
getDeclarationOfPropertyNameCaseInsensitive(String sPropertyName)
Deprecated.
Since 6.0.0 - use
getDeclarationOfPropertyName(String)
instead. |
boolean |
hasDeclarations() |
com.helger.commons.state.EChange |
removeAllDeclarations()
Remove all declarations.
|
com.helger.commons.state.EChange |
removeDeclaration(CSSDeclaration aDeclaration)
Remove the given declaration
|
com.helger.commons.state.EChange |
removeDeclaration(int nDeclarationIndex)
Remove the declaration at the specified index
|
IMPLTYPE |
setDeclarationAtIndex(int nIndex,
CSSDeclaration aNewDeclaration)
Set the declaration at the specified index with a new one.
|
getAsCSSString, getAsCSSString, getAsCSSString@Nonnull IMPLTYPE addDeclaration(@Nonnull CSSDeclaration aDeclaration)
aDeclaration - The declaration to be added. May not be null.@Nonnull default IMPLTYPE addDeclaration(@Nonnull @Nonempty String sProperty, @Nonnull CSSExpression aExpression, boolean bImportant)
sProperty - The name of the property. E.g. "color". May neither be
null nor empty.aExpression - The value of the property. May not be null.bImportant - true if it is important, false if not.@Nonnull IMPLTYPE addDeclaration(@Nonnegative int nIndex, @Nonnull CSSDeclaration aDeclaration)
nIndex - The index to retrieve. Must be ≥ 0. If the index is ≥ than
getDeclarationCount(), it behaves like
addDeclaration(CSSDeclaration).aDeclaration - The declaration to be added. May not be null.@Nonnull com.helger.commons.state.EChange removeDeclaration(@Nonnull CSSDeclaration aDeclaration)
aDeclaration - The declaration to be removed. May not be null.EChange.CHANGED if the declaration was successfully removed@Nonnull com.helger.commons.state.EChange removeDeclaration(@Nonnegative int nDeclarationIndex)
nDeclarationIndex - The index of the declaration to be removed. Must be ≥ 0.EChange.CHANGED if the declaration was successfully
removed, EChange.UNCHANGED if the index was invalid.@Nonnull com.helger.commons.state.EChange removeAllDeclarations()
EChange.CHANGED if any declaration was removed,
EChange.UNCHANGED otherwise. Never null.@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> getAllDeclarations()
null copy of all contained
declarations.@Nullable CSSDeclaration getDeclarationAtIndex(@Nonnegative int nIndex)
nIndex - The index to retrievenull if the
index is invalid@Nonnull IMPLTYPE setDeclarationAtIndex(@Nonnegative int nIndex, @Nonnull CSSDeclaration aNewDeclaration)
nIndex - The index to retrieve. Must be ≥ 0. If the index is ≥ than
getDeclarationCount(), it behaves like
addDeclaration(CSSDeclaration).aNewDeclaration - The new declaration to be set.boolean hasDeclarations()
true if at least one declaration is present,
false if no declaration is present.@Nonnegative int getDeclarationCount()
@Nullable CSSDeclaration getDeclarationOfPropertyName(@Nullable String sPropertyName)
null is returned. If more than one
declaration ith the specified property name is present, always the first in
the list will be returned. The comparison happens case insensitive
(since v6.0.0).sPropertyName - The property name of the declaration to search (e.g.
color). May be null.null if no such property name was found.@Nullable @Deprecated default CSSDeclaration getDeclarationOfPropertyNameCaseInsensitive(@Nullable String sPropertyName)
getDeclarationOfPropertyName(String)
instead.null is returned. If more than one
declaration ith the specified property name is present, always the first in
the list will be returned. The comparison happens case insensitive.sPropertyName - The property name of the declaration to search (e.g.
color). May be null.null if no such property name was found.@Nonnull @ReturnsMutableCopy com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> getAllDeclarationsOfPropertyName(@Nullable String sPropertyName)
sPropertyName - The property name of the declaration to search (e.g.
color). May be null.null but maybe an empty list.@Nonnull @ReturnsMutableCopy @Deprecated default com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> getAllDeclarationsOfPropertyNameCaseInsensitive(@Nullable String sPropertyName)
getAllDeclarationsOfPropertyName(String) instead.sPropertyName - The property name of the declaration to search (e.g.
color). May be null.null but maybe an empty list.Copyright © 2014–2022 Philip Helger. All rights reserved.