Package com.helger.css
Interface ICSSWriterSettings
-
- All Known Implementing Classes:
CSSWriterSettings
public interface ICSSWriterSettings
Settings 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 void
checkVersionRequirements(ICSSVersionAware aCSSObject)
Check if the passed object matches the version requirements defined be this settings.ECSSVersion
getCSSVersion()
String
getIndent(int nCount)
Get the indentation for an arbitrary number of levels.com.helger.commons.system.ENewLineMode
getNewLineMode()
String
getNewLineString()
default ECSSVersion
getVersion()
Deprecated.UsegetCSSVersion()
insteadboolean
isOptimizedOutput()
boolean
isQuoteURLs()
boolean
isRemoveUnnecessaryCode()
boolean
isWriteFontFaceRules()
boolean
isWriteKeyframesRules()
boolean
isWriteMediaRules()
boolean
isWriteNamespaceRules()
boolean
isWritePageRules()
boolean
isWriteSupportsRules()
boolean
isWriteUnknownRules()
boolean
isWriteViewportRules()
-
-
-
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:
true
if all unnecessary whitespaces should be ignored when writing.
-
isRemoveUnnecessaryCode
boolean isRemoveUnnecessaryCode()
- Returns:
true
if 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
null
but may be empty.
-
isQuoteURLs
boolean isQuoteURLs()
- Returns:
true
if all URL values should be quoted,false
if URL quoting should only be applied if absolutely necessary.
-
isWriteNamespaceRules
boolean isWriteNamespaceRules()
- Returns:
true
if @namespace rules should be written,false
if not
-
isWriteFontFaceRules
boolean isWriteFontFaceRules()
- Returns:
true
if @font-face rules should be written,false
if not
-
isWriteKeyframesRules
boolean isWriteKeyframesRules()
- Returns:
true
if @keyframes rules should be written,false
if not
-
isWriteMediaRules
boolean isWriteMediaRules()
- Returns:
true
if @media rules should be written,false
if not
-
isWritePageRules
boolean isWritePageRules()
- Returns:
true
if @page rules should be written,false
if not
-
isWriteViewportRules
boolean isWriteViewportRules()
- Returns:
true
if @viewport rules should be written,false
if not
-
isWriteSupportsRules
boolean isWriteSupportsRules()
- Returns:
true
if @supports rules should be written,false
if not
-
isWriteUnknownRules
boolean isWriteUnknownRules()
- Returns:
true
if unknown @ rules should be written,false
if 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()
-
-