public interface IHasCSSDeclarations<IMPLTYPE extends IHasCSSDeclarations<IMPLTYPE>> extends ICSSWriteable
| 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.
|
IMPLTYPE |
addDeclaration(String sProperty,
CSSExpression aExpression,
boolean bImportant)
Add a new declaration.
|
List<CSSDeclaration> |
getAllDeclarations() |
List<CSSDeclaration> |
getAllDeclarationsOfPropertyName(String sPropertyName)
Get all declarations within this list that have the specified property
name.
|
List<CSSDeclaration> |
getAllDeclarationsOfPropertyNameCaseInsensitive(String sPropertyName)
Get all declarations within this list that have the specified property
name.
|
CSSDeclaration |
getDeclarationAtIndex(int nIndex) |
int |
getDeclarationCount() |
CSSDeclaration |
getDeclarationOfPropertyName(String sPropertyName)
Get the first declaration with the specified property name.
|
CSSDeclaration |
getDeclarationOfPropertyNameCaseInsensitive(String sPropertyName)
Get the first declaration with the specified property name.
|
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@Nonnull IMPLTYPE addDeclaration(@Nonnull CSSDeclaration aDeclaration)
aDeclaration - The declaration to be added. May not be null.@Nonnull 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 List<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 sensitive.sPropertyName - The property name of the declaration to search (e.g.
color). May be null.null if no such property name was found.@Nullable CSSDeclaration getDeclarationOfPropertyNameCaseInsensitive(@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.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 List<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 List<CSSDeclaration> getAllDeclarationsOfPropertyNameCaseInsensitive(@Nullable String sPropertyName)
sPropertyName - The property name of the declaration to search (e.g.
color). May be null.null but maybe an empty list.Copyright © 2014–2016 Philip Helger. All rights reserved.