Mercurial Hosting > nabble
view src/fschmidt/html/HtmlNode.java @ 69:4bc1fc540265 default tip
update luan
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Sun, 05 Oct 2025 20:45:39 -0600 |
parents | 00520880ad02 |
children |
line wrap: on
line source
package fschmidt.html; public final class HtmlNode extends HtmlTag { public final Html children; public HtmlNode(HtmlTag tag,Html children) { super(tag); if( tag.isEmpty() ) throw new RuntimeException(); this.children = children; } @Override public String toString() { return super.toString() + children + "</" + getName() + ">"; } @Override public boolean equals(Object obj) { if( !super.equals(obj) ) return false; if( !(obj instanceof HtmlNode) ) return false; HtmlNode node = (HtmlNode)obj; return children.equals(node.children); } void flattenTo(Html html) { html.add( new HtmlTag(this) ); children.flattenTo(html); html.add( new HtmlTag( "/" + getName() ) ); } }