com.hfg.xml.XMLComment Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com_hfg Show documentation
Show all versions of com_hfg Show documentation
com.hfg xml, html, svg, and bioinformatics utility library
package com.hfg.xml;
import com.hfg.exception.ProgrammingException;
import com.hfg.html.Table;
import java.io.OutputStream;
import java.io.IOException;
import java.io.Writer;
public class XMLComment implements XMLizable
{
private String mComment;
//##########################################################################
// CONSTRUCTORS
//##########################################################################
//--------------------------------------------------------------------------
public XMLComment()
{
}
//--------------------------------------------------------------------------
public XMLComment(String inComment)
{
mComment = inComment;
}
//##########################################################################
// PUBLIC METHODS
//##########################################################################
//---------------------------------------------------------------------------
public XMLComment clone()
{
XMLComment cloneObj;
try
{
cloneObj = (XMLComment) super.clone();
}
catch (CloneNotSupportedException e)
{
throw new ProgrammingException(e);
}
return cloneObj;
}
//---------------------------------------------------------------------------
public boolean hasContent()
{
return true;
}
//---------------------------------------------------------------------------
public void setContent(String inContent)
{
mComment = inContent;
}
//---------------------------------------------------------------------------
/**
Clears content (not subtags).
*/
public void clearContent()
{
mComment = null;
}
//---------------------------------------------------------------------------
public void addContent(String inContent)
{
mComment += inContent;
}
//---------------------------------------------------------------------------
/**
The returned content does not contain any embedded subtags.
*/
public String getContent()
{
return mComment;
}
//---------------------------------------------------------------------------
public String toXML()
{
return "";
}
//---------------------------------------------------------------------------
public void toXML(Writer inWriter)
{
try
{
inWriter.write(toXML());
}
catch (IOException e)
{
throw new RuntimeException(e);
}
}
//---------------------------------------------------------------------------
public void toXML(OutputStream inStream)
{
try
{
inStream.write(toXML().getBytes());
}
catch (Exception e)
{
throw new XMLException(e);
}
}
//--------------------------------------------------------------------------
public String toIndentedXML(int inInitialIndentLevel, int inIndentSize)
{
return toXML();
}
//--------------------------------------------------------------------------
public void toIndentedXML(OutputStream inOutputStream, int inInitialIndentLevel, int inIndentSize)
{
toXML(inOutputStream);
}
//--------------------------------------------------------------------------
public void toIndentedXML(Writer inWriter, int inInitialIndentLevel, int inIndentSize)
{
toXML(inWriter);
}
}