Mercurial Hosting > nabble
diff src/nabble/naml/dom/EmptyElement.java @ 0:7ecd1a4ef557
add content
author | Franklin Schmidt <fschmidt@gmail.com> |
---|---|
date | Thu, 21 Mar 2019 19:15:52 -0600 |
parents | |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/nabble/naml/dom/EmptyElement.java Thu Mar 21 19:15:52 2019 -0600 @@ -0,0 +1,33 @@ +package nabble.naml.dom; + +import java.util.Collection; + + +public final class EmptyElement extends Element { + + public EmptyElement(ElementName name,Collection<Attribute> attributes,String spaceAtEndOfOpeningTag,int lineNumber) { + super(name,attributes,spaceAtEndOfOpeningTag,lineNumber); + } + + public String toString() { + StringBuilder buf = new StringBuilder(); + addStartTag(buf); + buf.append( "/>" ); + return buf.toString(); + } + + public String openingTag() { + return toString(); + } + +/* + public boolean equals(Object obj) { + if( !(obj instanceof EmptyElement) ) + return false; + EmptyElement element = (EmptyElement)obj; + return element.name.equals(name) + && element.attrMap.equals(attrMap) + ; + } +*/ +}