Class CssFile
java.lang.Object
com.webfirmframework.wffweb.css.file.CssFile
- All Implemented Interfaces:
Serializable
,Cloneable
- Since:
- 1.0.0
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected final void
final boolean
boolean
void
setOptimizeCssString
(boolean optimizeCssString) optimizes thetoCssString
output.void
setPrependCharset
(boolean prependCharset) prepends the charset declaration (eg:@CHARSET "UTF-8";
) while writing css string to the output stream bytoOutputStream
methods.toCssString
(boolean rebuild) void
void
toOutputStream
(OutputStream os, boolean rebuild) void
toOutputStream
(OutputStream os, String charset) void
toOutputStream
(OutputStream os, String charsetName, boolean rebuild) void
toOutputStream
(OutputStream os, Charset charset) void
toOutputStream
(OutputStream os, Charset charset, boolean rebuild) toString()
-
Constructor Details
-
CssFile
public CssFile()
-
-
Method Details
-
initCssFile
protected final void initCssFile() -
getCssBlocks
- Returns:
- the cssBlocks
- Since:
- 1.0.0
-
toString
-
toCssString
- Returns:
- the css string. i.e. the contents in the css file as a string.
- Since:
- 1.0.0
-
toCssString
- Parameters:
rebuild
- true to force to rebuild- Returns:
- the css string. i.e. the contents in the css file as a string.
- Since:
- 1.0.0
-
toOutputStream
- Parameters:
os
- theOutputStream
object to writecharset
- the charset type of bytes to write- Throws:
IOException
- Since:
- 1.1.2
-
toOutputStream
- Parameters:
os
- theOutputStream
object to writecharsetName
- the charset type of bytes to writerebuild
- the load method in CssBlocked will be invoked a gain- Throws:
IOException
- Since:
- 1.1.2
-
toOutputStream
- Parameters:
os
- theOutputStream
object to writerebuild
- the load method in CssBlocked will be invoked a gain- Throws:
IOException
- Since:
- 1.1.2
-
toOutputStream
- Parameters:
os
- theOutputStream
object to writecharset
- the charset type of bytes to write- Throws:
IOException
- Since:
- 1.1.2
-
toOutputStream
- Parameters:
os
- theOutputStream
object to writecharset
- the charset type of bytes to write- Throws:
IOException
- Since:
- 1.1.2
-
toOutputStream
- Parameters:
os
- theOutputStream
object to write- Throws:
IOException
- Since:
- 1.1.2
-
isOptimizeCssString
public final boolean isOptimizeCssString()- Returns:
- true if the toCssString to be optimized.
- Since:
- 1.0.0
-
setOptimizeCssString
public void setOptimizeCssString(boolean optimizeCssString) optimizes thetoCssString
output. For instance the optimized output for the following blocks in theCssFile
extended class will be.test4-class{list-style-position:outside;background-repeat:no-repeat;}
.
private CssBlock cssBlock1 = new CssBlock(".test4-class")
{
@Override
protected void load(Set<CssProperty> cssProperties) {
cssProperties.add(ListStylePosition.INSIDE);
}
};
private CssBlock cssBlock2 = new CssBlock(".test4-class")
{
@Override
protected void load(Set<CssProperty> cssProperties) {
cssProperties.add(BackgroundRepeat.NO_REPEAT);
cssProperties.add(ListStylePosition.OUTSIDE);
}
};
- Parameters:
optimizeCssString
- the optimizeCssString to set. true to optimize thetoCssString
value and false to turn off optimization. The default value is true.- Since:
- 1.0.0
-
isPrependCharset
public boolean isPrependCharset()- Returns:
- true or false
- Since:
- 1.1.2
-
setPrependCharset
public void setPrependCharset(boolean prependCharset) prepends the charset declaration (eg:@CHARSET "UTF-8";
) while writing css string to the output stream bytoOutputStream
methods.- Parameters:
prependCharset
- true to prepend the charset declaration (eg:@CHARSET "UTF-8";
) while writing css string to the output stream bytoOutputStream
methods.- Since:
- 1.1.2
-