Package com.oorian.css
Class CssElement
java.lang.Object
com.oorian.css.CssElement
- Direct Known Subclasses:
CssMediaQuery,CssRule,KeyFrames
Abstract base class for all dynamic CSS elements in the stylesheet hierarchy.
CssElement provides the foundation for building CSS constructs programmatically. It defines a lifecycle for initialization and creation that subclasses can override to define their specific CSS content.
The initialization process follows this order:
create()- Called first to set up the element's own CSS contentinitializeChildren()- Called to initialize any child elements
- Author:
- Marvin P. Warble Jr.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddNewLine(boolean pretty, StringBuilder element) Appends a newline character to the output when pretty printing is enabled.protected voidcreate()Creates this element's CSS content.protected voidInitializes any child CSS elements.
-
Constructor Details
-
CssElement
public CssElement()Constructs a new CSS element.
-
-
Method Details
-
create
protected void create()Creates this element's CSS content.Subclasses should override this method to define CSS rules, properties, or other content. The default implementation does nothing.
-
addNewLine
Appends a newline character to the output when pretty printing is enabled.- Parameters:
pretty- True to append a newline, false to skip.element- The StringBuilder to append to.
-
initializeChildren
protected void initializeChildren()Initializes any child CSS elements.Subclasses that contain child elements should override this method to call initialize() on each child. The default implementation does nothing.
-