org.apache.jorphan.util

Class XMLBuffer


public class XMLBuffer
extends Object

Provides XML string building methods. Not synchronised.

Constructor Summary

XMLBuffer()

Method Summary

XMLBuffer
closeTag(String tagname)
Close top tag from stack.
XMLBuffer
openTag(String tagname)
Open a tag; save on stack.
XMLBuffer
tag(String tagname, String content)
Add a complete tag with content.
XMLBuffer
tag(String tagname, StringBuffer content)
Add a complete tag with content.
String
toString()
Convert the buffer to a string, closing any open tags

Constructor Details

XMLBuffer

public XMLBuffer()

Method Details

closeTag

public XMLBuffer closeTag(String tagname)
Close top tag from stack.
Parameters:
tagname -
Returns:
this

openTag

public XMLBuffer openTag(String tagname)
Open a tag; save on stack.
Parameters:
tagname -
Returns:
this

tag

public XMLBuffer tag(String tagname,
                     String content)
Add a complete tag with content.
Parameters:
tagname -
content -
Returns:
this

tag

public XMLBuffer tag(String tagname,
                     StringBuffer content)
Add a complete tag with content.
Parameters:
tagname -
content -
Returns:
this

toString

public String toString()
Convert the buffer to a string, closing any open tags

Copyright © 1998-2010 Apache Software Foundation. All Rights Reserved.