view src/goodjava/xml/Xml.java @ 1831:8f9ae295bf6a default tip

add Hosted.authorize
author Franklin Schmidt <fschmidt@gmail.com>
date Thu, 26 Sep 2024 15:07:45 -0600
parents a8c685a894b4
children
line wrap: on
line source

package goodjava.xml;


public final class Xml {
	public String declaration;
	private XmlElement element;

	public XmlElement getElement() {
		return element;
	}

	public void setElement(XmlElement element) {
		if( element == null )
			throw new IllegalArgumentException("element can't be null");
		this.element = element;
	}

	@Override public String toString() {
		StringBuilder sb = new StringBuilder();
		if( declaration != null ) {
			sb.append( declaration );
			sb.append( '\n' );
		}
		element.toString(sb,0);
		return sb.toString();
	}
}