public class XMLWriter
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.lang.StringBuilder |
buffer
Buffer.
|
static int |
CLOSING
Closing tag.
|
static int |
NO_CONTENT
Element with no content.
|
static int |
OPENING
Opening tag.
|
protected java.io.Writer |
writer
Writer.
|
Constructor and Description |
---|
XMLWriter()
Constructor.
|
XMLWriter(java.io.Writer writer)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
sendData()
Send data and reinitializes buffer.
|
java.lang.String |
toString()
Retrieve generated XML.
|
void |
writeData(java.lang.String data)
Write data.
|
void |
writeElement(java.lang.String namespace,
java.lang.String name,
int type)
Write an element.
|
void |
writeElement(java.lang.String namespace,
java.lang.String namespaceInfo,
java.lang.String name,
int type)
Write an element.
|
void |
writeProperty(java.lang.String namespace,
java.lang.String name,
java.lang.String value)
Write property to the XML.
|
void |
writeText(java.lang.String text)
Write text.
|
void |
writeXMLHeader()
Write XML Header.
|
public static final int OPENING
public static final int CLOSING
public static final int NO_CONTENT
protected java.lang.StringBuilder buffer
protected final java.io.Writer writer
public XMLWriter()
public XMLWriter(java.io.Writer writer)
public java.lang.String toString()
toString
in class java.lang.Object
public void writeProperty(java.lang.String namespace, java.lang.String name, java.lang.String value)
namespace
- Namespacename
- Property namevalue
- Property valuepublic void writeElement(java.lang.String namespace, java.lang.String name, int type)
name
- Element namenamespace
- Namespace abbreviationtype
- Element typepublic void writeElement(java.lang.String namespace, java.lang.String namespaceInfo, java.lang.String name, int type)
namespace
- Namespace abbreviationnamespaceInfo
- Namespace infoname
- Element nametype
- Element typepublic void writeText(java.lang.String text)
text
- Text to appendpublic void writeData(java.lang.String data)
data
- Data to appendpublic void writeXMLHeader()
public void sendData() throws java.io.IOException
java.io.IOException
Copyright © 2000-2018 Apache Software Foundation. All Rights Reserved.