public class CSSPageMarginBlock extends Object implements ICSSPageRuleMember, ICSSVersionAware, IHasCSSDeclarations<CSSPageMarginBlock>
Constructor and Description |
---|
CSSPageMarginBlock(String sPargeMarginSymbol) |
Modifier and Type | Method and Description |
---|---|
CSSPageMarginBlock |
addDeclaration(CSSDeclaration aDeclaration)
Add a new declaration.
|
CSSPageMarginBlock |
addDeclaration(int nIndex,
CSSDeclaration aNewDeclaration)
Add a new declaration at the specified index.
|
boolean |
equals(Object o) |
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.
|
String |
getAsCSSString(ICSSWriterSettings aSettings,
int nIndentLevel)
Get the contents of this object as a serialized CSS string for writing to
an output.
|
CSSDeclaration |
getDeclarationAtIndex(int nIndex) |
int |
getDeclarationCount() |
CSSDeclaration |
getDeclarationOfPropertyName(String sPropertyName)
Get the first declaration with the specified property name.
|
ECSSVersion |
getMinimumCSSVersion() |
String |
getPageMarginSymbol() |
CSSSourceLocation |
getSourceLocation() |
boolean |
hasDeclarations() |
int |
hashCode() |
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
|
CSSPageMarginBlock |
setDeclarationAtIndex(int nIndex,
CSSDeclaration aNewDeclaration)
Set the declaration at the specified index with a new one.
|
CSSPageMarginBlock |
setPageMarginSymbol(String sPargeMarginSymbol) |
void |
setSourceLocation(CSSSourceLocation aSourceLocation) |
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
addDeclaration, getAllDeclarationsOfPropertyNameCaseInsensitive, getDeclarationOfPropertyNameCaseInsensitive
getAsCSSString, getAsCSSString
@Nonnull public CSSPageMarginBlock setPageMarginSymbol(@Nonnull @Nonempty String sPargeMarginSymbol)
@Nonnull public CSSPageMarginBlock addDeclaration(@Nonnull CSSDeclaration aDeclaration)
IHasCSSDeclarations
addDeclaration
in interface IHasCSSDeclarations<CSSPageMarginBlock>
aDeclaration
- The declaration to be added. May not be null
.@Nonnull public CSSPageMarginBlock addDeclaration(@Nonnegative int nIndex, @Nonnull CSSDeclaration aNewDeclaration)
IHasCSSDeclarations
addDeclaration
in interface IHasCSSDeclarations<CSSPageMarginBlock>
nIndex
- The index to retrieve. Must be ≥ 0. If the index is ≥ than
getDeclarationCount()
, it behaves like
IHasCSSDeclarations.addDeclaration(CSSDeclaration)
.aNewDeclaration
- The declaration to be added. May not be null
.@Nonnull public com.helger.commons.state.EChange removeDeclaration(@Nonnull CSSDeclaration aDeclaration)
IHasCSSDeclarations
removeDeclaration
in interface IHasCSSDeclarations<CSSPageMarginBlock>
aDeclaration
- The declaration to be removed. May not be null
.EChange.CHANGED
if the declaration was successfully removed@Nonnull public com.helger.commons.state.EChange removeDeclaration(@Nonnegative int nDeclarationIndex)
IHasCSSDeclarations
removeDeclaration
in interface IHasCSSDeclarations<CSSPageMarginBlock>
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 public com.helger.commons.state.EChange removeAllDeclarations()
IHasCSSDeclarations
removeAllDeclarations
in interface IHasCSSDeclarations<CSSPageMarginBlock>
EChange.CHANGED
if any declaration was removed,
EChange.UNCHANGED
otherwise. Never null
.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> getAllDeclarations()
getAllDeclarations
in interface IHasCSSDeclarations<CSSPageMarginBlock>
null
copy of all contained
declarations.@Nullable public CSSDeclaration getDeclarationAtIndex(@Nonnegative int nIndex)
getDeclarationAtIndex
in interface IHasCSSDeclarations<CSSPageMarginBlock>
nIndex
- The index to retrievenull
if the
index is invalid@Nonnull public CSSPageMarginBlock setDeclarationAtIndex(@Nonnegative int nIndex, @Nonnull CSSDeclaration aNewDeclaration)
IHasCSSDeclarations
setDeclarationAtIndex
in interface IHasCSSDeclarations<CSSPageMarginBlock>
nIndex
- The index to retrieve. Must be ≥ 0. If the index is ≥ than
getDeclarationCount()
, it behaves like
IHasCSSDeclarations.addDeclaration(CSSDeclaration)
.aNewDeclaration
- The new declaration to be set.public boolean hasDeclarations()
hasDeclarations
in interface IHasCSSDeclarations<CSSPageMarginBlock>
true
if at least one declaration is present,
false
if no declaration is present.@Nonnegative public int getDeclarationCount()
getDeclarationCount
in interface IHasCSSDeclarations<CSSPageMarginBlock>
@Nullable public CSSDeclaration getDeclarationOfPropertyName(@Nullable String sPropertyName)
IHasCSSDeclarations
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).getDeclarationOfPropertyName
in interface IHasCSSDeclarations<CSSPageMarginBlock>
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 public com.helger.commons.collection.impl.ICommonsList<CSSDeclaration> getAllDeclarationsOfPropertyName(@Nullable String sPropertyName)
IHasCSSDeclarations
getAllDeclarationsOfPropertyName
in interface IHasCSSDeclarations<CSSPageMarginBlock>
sPropertyName
- The property name of the declaration to search (e.g.
color
). May be null
.null
but maybe an empty list.@Nonnull @Nonempty public String getAsCSSString(@Nonnull ICSSWriterSettings aSettings, @Nonnegative int nIndentLevel)
ICSSWriteable
getAsCSSString
in interface ICSSWriteable
aSettings
- The settings to be used to format the output. May not be
null
.nIndentLevel
- The current indentation levelnull
.@Nonnull public ECSSVersion getMinimumCSSVersion()
getMinimumCSSVersion
in interface ICSSVersionAware
null
.public void setSourceLocation(@Nullable CSSSourceLocation aSourceLocation)
@Nullable public CSSSourceLocation getSourceLocation()
Copyright © 2014–2021 Philip Helger. All rights reserved.