Package org.spiderwiz.zutils
Class ZHtml.Node
java.lang.Object
org.spiderwiz.zutils.ZHtml.Node
- Direct Known Subclasses:
ZHtml.Cell
,ZHtml.Document
,ZHtml.Heading
,ZHtml.Row
,ZHtml.Table
,ZHtml.TextNode
- Enclosing class:
- ZHtml
public abstract class ZHtml.Node extends Object
Represents an HTML node.
-
Method Summary
Modifier and Type Method Description String
addStyle(String style)
Adds a style to the node's current list of styles.ZHtml.Anchor
createAnchor(String text, String ref, String... args)
Instantiates an anchor node (a
tag) with the given text, url (ref
attribute) and optional arguments to inject in the url.ZHtml.Paragraph
createParagraph(String text)
Instantiates a paragraph node (p
tag) with the given text.ZHtml.TextNode
createTextNode(String text)
Instantiates a node with the given text.
-
Method Details
-
createTextNode
Instantiates a node with the given text.The method just instantiates the node without connecting it to any other node. This can be done with methods such as
TextNode.addNode()
etc.- Parameters:
text
- the text contained in the returned node.- Returns:
- the instantiated node.
-
createParagraph
Instantiates a paragraph node (p
tag) with the given text.The method just instantiates the node without connecting it to any other node. This can be done with methods such as
TextNode.addNode()
etc.- Parameters:
text
- the text contained in the returned paragraph node.- Returns:
- the instantiated paragraph node.
-
createAnchor
Instantiates an anchor node (a
tag) with the given text, url (ref
attribute) and optional arguments to inject in the url.- Parameters:
text
- the text displayed in the node.ref
- the url (ref attribute) that the node links to.args
- a variable list of parameter to inject in the url in the format ...?arg1&arg2&arg3 etc.- Returns:
- the instantiated Anchor object.
-
addStyle
Adds a style to the node's current list of styles.- Parameters:
style
- the style to add- Returns:
- the full list of styles, concatenated by a semicolon (;).
-