@NotThreadSafe public class CSSExpression extends Object implements ICSSWriteable, ICSSSourceLocationAware
| Constructor and Description |
|---|
CSSExpression() |
| Modifier and Type | Method and Description |
|---|---|
CSSExpression |
addMember(ICSSExpressionMember aMember)
Add an expression member
|
CSSExpression |
addMember(int nIndex,
ICSSExpressionMember aMember)
Add an expression member
|
CSSExpression |
addNumber(double dValue)
Shortcut method to add a numeric value
|
CSSExpression |
addNumber(float fValue)
Shortcut method to add a numeric value
|
CSSExpression |
addNumber(int nValue)
Shortcut method to add a numeric value
|
CSSExpression |
addNumber(int nIndex,
double dValue)
Shortcut method to add a numeric value
|
CSSExpression |
addNumber(int nIndex,
float fValue)
Shortcut method to add a numeric value
|
CSSExpression |
addNumber(int nIndex,
int nValue)
Shortcut method to add a numeric value
|
CSSExpression |
addNumber(int nIndex,
long nValue)
Shortcut method to add a numeric value
|
CSSExpression |
addNumber(long nValue)
Shortcut method to add a numeric value
|
CSSExpression |
addString(int nIndex,
String sValue)
Shortcut method to add a string value that is automatically quoted inside
|
CSSExpression |
addString(String sValue)
Shortcut method to add a string value that is automatically quoted inside
|
CSSExpression |
addTermSimple(int nIndex,
String sValue)
Shortcut method to add a simple text value.
|
CSSExpression |
addTermSimple(String sValue)
Shortcut method to add a simple text value.
|
CSSExpression |
addURI(int nIndex,
String sURI)
Shortcut method to add a URI value
|
CSSExpression |
addURI(String sURI)
Shortcut method to add a URI value
|
static CSSExpression |
createNumber(double dValue)
Create a CSS expression only containing a numeric value
|
static CSSExpression |
createNumber(float fValue)
Create a CSS expression only containing a numeric value
|
static CSSExpression |
createNumber(int nValue)
Create a CSS expression only containing a numeric value
|
static CSSExpression |
createNumber(long nValue)
Create a CSS expression only containing a numeric value
|
static CSSExpression |
createSimple(String sValue)
Create a CSS expression only containing a text value
|
static CSSExpression |
createString(String sValue)
Create a CSS expression only containing a string
|
static CSSExpression |
createURI(String sURI)
Create a CSS expression only containing a URI
|
boolean |
equals(Object o) |
com.helger.commons.collection.impl.ICommonsList<ICSSExpressionMember> |
getAllMembers() |
com.helger.commons.collection.impl.ICommonsList<CSSExpressionMemberTermSimple> |
getAllSimpleMembers() |
String |
getAsCSSString(ICSSWriterSettings aSettings,
int nIndentLevel)
Get the contents of this object as a serialized CSS string for writing to
an output.
|
ICSSExpressionMember |
getMemberAtIndex(int nIndex)
Get the expression member at the specified index.
|
int |
getMemberCount() |
static String |
getQuotedStringValue(String sValue)
Get a quoted string value.
|
CSSSourceLocation |
getSourceLocation() |
int |
hashCode() |
com.helger.commons.state.EChange |
removeAllMembers()
Remove all members.
|
com.helger.commons.state.EChange |
removeMember(ICSSExpressionMember aMember)
Remove the passed expression member
|
com.helger.commons.state.EChange |
removeMember(int nMemberIndex)
Remove the expression member at the specified in
|
void |
setSourceLocation(CSSSourceLocation aSourceLocation)
Set the source location of the object, determined while parsing.
|
String |
toString() |
clone, finalize, getClass, notify, notifyAll, wait, wait, waitgetAsCSSString, getAsCSSString@Nonnull public CSSExpression addMember(@Nonnull ICSSExpressionMember aMember)
aMember - The member to be added. May not be null.@Nonnull public CSSExpression addMember(@Nonnegative int nIndex, @Nonnull ICSSExpressionMember aMember)
nIndex - The index where the member should be added. Must be ≥ 0.aMember - The member to be added. May not be null.@Nonnull public CSSExpression addTermSimple(@Nonnull @Nonempty String sValue)
sValue - The value to be added. May neither be null nor empty.@Nonnull public CSSExpression addTermSimple(@Nonnegative int nIndex, @Nonnull @Nonempty String sValue)
nIndex - The index where the member should be added. Must be ≥ 0.sValue - The value to be added. May neither be null nor empty.@Nonnull public CSSExpression addNumber(int nValue)
nValue - The value to be added.@Nonnull public CSSExpression addNumber(@Nonnegative int nIndex, int nValue)
nIndex - The index where the member should be added. Must be ≥ 0.nValue - The value to be added.@Nonnull public CSSExpression addNumber(long nValue)
nValue - The value to be added.@Nonnull public CSSExpression addNumber(@Nonnegative int nIndex, long nValue)
nIndex - The index where the member should be added. Must be ≥ 0.nValue - The value to be added.@Nonnull public CSSExpression addNumber(float fValue)
fValue - The value to be added.@Nonnull public CSSExpression addNumber(@Nonnegative int nIndex, float fValue)
nIndex - The index where the member should be added. Must be ≥ 0.fValue - The value to be added.@Nonnull public CSSExpression addNumber(double dValue)
dValue - The value to be added.@Nonnull public CSSExpression addNumber(@Nonnegative int nIndex, double dValue)
nIndex - The index where the member should be added. Must be ≥ 0.dValue - The value to be added.@Nonnull @Nonempty public static String getQuotedStringValue(@Nonnull String sValue)
sValue - The source value. May not be null.@Nonnull public CSSExpression addString(@Nonnull String sValue)
sValue - The value to be quoted and than added. May not be null.@Nonnull public CSSExpression addString(@Nonnegative int nIndex, @Nonnull String sValue)
nIndex - The index where the member should be added. Must be ≥ 0.sValue - The value to be quoted and than added. May not be null.@Nonnull public CSSExpression addURI(@Nonnull @Nonempty String sURI)
sURI - The value to be added. May neither be null nor empty@Nonnull public CSSExpression addURI(@Nonnegative int nIndex, @Nonnull @Nonempty String sURI)
nIndex - The index where the member should be added. Must be ≥ 0.sURI - The value to be added. May neither be null nor empty@Nonnull public com.helger.commons.state.EChange removeMember(@Nullable ICSSExpressionMember aMember)
aMember - The member to be removed. May be null.EChange@Nonnull public com.helger.commons.state.EChange removeMember(@Nonnegative int nMemberIndex)
nMemberIndex - the index of the member to be removed. May not be < 0.EChange@Nonnull public com.helger.commons.state.EChange removeAllMembers()
EChange.CHANGED if any member was removed,
EChange.UNCHANGED otherwise. Never null.@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<ICSSExpressionMember> getAllMembers()
null
.@Nullable public ICSSExpressionMember getMemberAtIndex(@Nonnegative int nIndex)
nIndex - The index to be retrievednull if an invalid member index was passed.@Nonnegative public int getMemberCount()
@Nonnull public com.helger.commons.collection.impl.ICommonsList<CSSExpressionMemberTermSimple> getAllSimpleMembers()
CSSExpressionMemberTermSimple@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 levelnull.@Nullable public final CSSSourceLocation getSourceLocation()
getSourceLocation in interface ICSSSourceLocationAwarenull if an object was not read but manually
created.public final void setSourceLocation(@Nullable CSSSourceLocation aSourceLocation)
ICSSSourceLocationAwaresetSourceLocation in interface ICSSSourceLocationAwareaSourceLocation - The source location to use. May be null.@Nonnull public static CSSExpression createSimple(@Nonnull @Nonempty String sValue)
sValue - The value to be wrapped in an expression@Nonnull public static CSSExpression createString(@Nonnull @Nonempty String sValue)
sValue - The value to be wrapped in a string@Nonnull public static CSSExpression createNumber(int nValue)
nValue - The value to be wrapped in an expression@Nonnull public static CSSExpression createNumber(long nValue)
nValue - The value to be wrapped in an expression@Nonnull public static CSSExpression createNumber(float fValue)
fValue - The value to be wrapped in an expression@Nonnull public static CSSExpression createNumber(double dValue)
dValue - The value to be wrapped in an expression@Nonnull public static CSSExpression createURI(@Nonnull @Nonempty String sURI)
sURI - The URI to be wrapped in an expressionCopyright © 2014–2022 Philip Helger. All rights reserved.