Package com.helger.css
Interface ICSSWriterSettings
-
- All Known Implementing Classes:
CSSWriterSettings
public interface ICSSWriterSettingsSettings for customizing the serialization of CSS properties etc.- Author:
- Philip Helger
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description voidcheckVersionRequirements(ICSSVersionAware aCSSObject)Check if the passed object matches the version requirements defined be this settings.ECSSVersiongetCSSVersion()StringgetIndent(int nCount)Get the indentation for an arbitrary number of levels.com.helger.commons.system.ENewLineModegetNewLineMode()StringgetNewLineString()default ECSSVersiongetVersion()Deprecated.UsegetCSSVersion()insteadbooleanisOptimizedOutput()booleanisQuoteURLs()booleanisRemoveUnnecessaryCode()booleanisWriteFontFaceRules()booleanisWriteKeyframesRules()booleanisWriteMediaRules()booleanisWriteNamespaceRules()booleanisWritePageRules()booleanisWriteSupportsRules()booleanisWriteUnknownRules()booleanisWriteViewportRules()
-
-
-
Method Detail
-
getCSSVersion
@Nonnull ECSSVersion getCSSVersion()
- Returns:
- The CSS version to be used. May not be
null. - Since:
- v6.2.0
-
getVersion
@Nonnull @Deprecated default ECSSVersion getVersion()
Deprecated.UsegetCSSVersion()instead- Returns:
- The CSS version to be used. May not be
null.
-
isOptimizedOutput
boolean isOptimizedOutput()
- Returns:
trueif all unnecessary whitespaces should be ignored when writing.
-
isRemoveUnnecessaryCode
boolean isRemoveUnnecessaryCode()
- Returns:
trueif all unnecessary elements (like empty style declarations) should be removed. This will than potentially lead to CSS that is not equal to the original CSS!
-
getNewLineMode
@Nonnull com.helger.commons.system.ENewLineMode getNewLineMode()
- Returns:
- The new line mode to be used for emitting the file. By default the Unix new line mode ("\n") is used.
-
getNewLineString
@Nonnull @Nonempty String getNewLineString()
- Returns:
- The string underlying the new line mode
- See Also:
getNewLineMode()
-
getIndent
@Nonnull String getIndent(@Nonnegative int nCount)
Get the indentation for an arbitrary number of levels. This can be used to customize the indentation strategy like using tabs or spaces, how many spaces etc.- Parameters:
nCount- The number of indentations desired. Always ≥ 0.- Returns:
- The string to be used for indentation. May not be
nullbut may be empty.
-
isQuoteURLs
boolean isQuoteURLs()
- Returns:
trueif all URL values should be quoted,falseif URL quoting should only be applied if absolutely necessary.
-
isWriteNamespaceRules
boolean isWriteNamespaceRules()
- Returns:
trueif @namespace rules should be written,falseif not
-
isWriteFontFaceRules
boolean isWriteFontFaceRules()
- Returns:
trueif @font-face rules should be written,falseif not
-
isWriteKeyframesRules
boolean isWriteKeyframesRules()
- Returns:
trueif @keyframes rules should be written,falseif not
-
isWriteMediaRules
boolean isWriteMediaRules()
- Returns:
trueif @media rules should be written,falseif not
-
isWritePageRules
boolean isWritePageRules()
- Returns:
trueif @page rules should be written,falseif not
-
isWriteViewportRules
boolean isWriteViewportRules()
- Returns:
trueif @viewport rules should be written,falseif not
-
isWriteSupportsRules
boolean isWriteSupportsRules()
- Returns:
trueif @supports rules should be written,falseif not
-
isWriteUnknownRules
boolean isWriteUnknownRules()
- Returns:
trueif unknown @ rules should be written,falseif not
-
checkVersionRequirements
void checkVersionRequirements(@Nonnull ICSSVersionAware aCSSObject) throws IllegalStateException
Check if the passed object matches the version requirements defined be this settings.- Parameters:
aCSSObject- The object to be checked.- Throws:
IllegalStateException- In case the version does not match- See Also:
getVersion()
-
-