Package com.helger.css.property
Class AbstractCSSProperty
- java.lang.Object
-
- com.helger.css.property.AbstractCSSProperty
-
- All Implemented Interfaces:
ICSSVersionAware,ICSSProperty
- Direct Known Subclasses:
CSSPropertyColor,CSSPropertyColors,CSSPropertyDouble,CSSPropertyEnum,CSSPropertyFree,CSSPropertyLong,CSSPropertyNumber,CSSPropertyNumbers,CSSPropertyURL
@NotThreadSafe public abstract class AbstractCSSProperty extends Object implements ICSSProperty
Abstract base class for implementingICSSProperty- Author:
- Philip Helger
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedAbstractCSSProperty(ECSSProperty eProp, ECSSVendorPrefix eVendorPrefix, ICSSPropertyCustomizer aCustomizer)Constructor
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(Object o)ICSSPropertyCustomizergetCustomizer()intgetMaximumArgumentCount()intgetMinimumArgumentCount()ECSSVersiongetMinimumCSSVersion()ECSSPropertygetProp()StringgetPropertyName()ECSSVendorPrefixgetVendorPrefix()inthashCode()static booleanisValidPropertyValue(String sValue)booleanisValidValue(String sValue)Check if the passed value is valid for this property according to the defined rule.ICSSValuenewValue(String sValue, boolean bIsImportant)Create a new CSS value with this property and the specified value.StringtoString()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.css.property.ICSSProperty
getClone, getClone, newImportantValue, newImportantValue, newValue, newValue, newValue
-
-
-
-
Constructor Detail
-
AbstractCSSProperty
protected AbstractCSSProperty(@Nonnull ECSSProperty eProp, @Nullable ECSSVendorPrefix eVendorPrefix, @Nullable ICSSPropertyCustomizer aCustomizer)
Constructor- Parameters:
eProp- The base property to use. May not benull.eVendorPrefix- The vendor prefix to be used. May benull.aCustomizer- The customizer to be used. May benull.
-
-
Method Detail
-
getMinimumCSSVersion
@Nonnull public final ECSSVersion getMinimumCSSVersion()
- Specified by:
getMinimumCSSVersionin interfaceICSSVersionAware- Returns:
- The minimum CSS version that is required to read or write this
artifact. May not be
null.
-
getProp
@Nonnull public final ECSSProperty getProp()
- Specified by:
getPropin interfaceICSSProperty- Returns:
- The underlying base property. Never
null.
-
getVendorPrefix
@Nullable public final ECSSVendorPrefix getVendorPrefix()
- Specified by:
getVendorPrefixin interfaceICSSProperty- Returns:
- The vendor prefix to be used. May be
null.
-
getPropertyName
@Nonnull @Nonempty public final String getPropertyName()
- Specified by:
getPropertyNamein interfaceICSSProperty- Returns:
- The property name including an eventually contained vendor prefix.
Neither
nullnor empty.
-
getCustomizer
@Nullable public final ICSSPropertyCustomizer getCustomizer()
- Specified by:
getCustomizerin interfaceICSSProperty- Returns:
- The CSS customizer assigned to this property. May be
null.
-
getMinimumArgumentCount
@Nonnegative @OverrideOnDemand public int getMinimumArgumentCount()
- Specified by:
getMinimumArgumentCountin interfaceICSSProperty- Returns:
- The minimum number of arguments for this property.
-
getMaximumArgumentCount
@Nonnegative @OverrideOnDemand public int getMaximumArgumentCount()
- Specified by:
getMaximumArgumentCountin interfaceICSSProperty- Returns:
- The maximum number of arguments for this property.
-
isValidValue
@OverridingMethodsMustInvokeSuper public boolean isValidValue(@Nullable String sValue)
Description copied from interface:ICSSPropertyCheck if the passed value is valid for this property according to the defined rule.- Specified by:
isValidValuein interfaceICSSProperty- Parameters:
sValue- The value to check. May benull.- Returns:
trueif the value is valid,falseotherwise
-
newValue
@Nonnull public ICSSValue newValue(@Nonnull @Nonempty String sValue, boolean bIsImportant)
Description copied from interface:ICSSPropertyCreate a new CSS value with this property and the specified value.- Specified by:
newValuein interfaceICSSProperty- Parameters:
sValue- The CSS String value. May neither benullnor empty.bIsImportant-trueif it is an important value,falseif not- Returns:
- Never
null.
-
-