public class XMLWriter extends Object
Modifier and Type | Field and Description |
---|---|
protected boolean |
_isRootElement
Is true until the root element is written
|
protected Map<String,String> |
_namespaces
Namespaces to be declared in the root element
|
protected PrintWriter |
_writer
Writer.
|
static int |
CLOSING
Closing tag.
|
static int |
NO_CONTENT
Element with no content.
|
static int |
OPENING
Opening tag.
|
Constructor and Description |
---|
XMLWriter(PrintWriter writer,
Map<String,String> namespaces)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
sendData()
Send data and reinitializes buffer.
|
void |
writeData(String data)
Write data.
|
void |
writeElement(String name,
int type)
Write an element.
|
void |
writeProperty(String name)
Write property to the XML.
|
void |
writeProperty(String name,
String value)
Write property to the XML.
|
void |
writeText(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 PrintWriter _writer
protected boolean _isRootElement
public XMLWriter(PrintWriter writer, Map<String,String> namespaces)
public void writeProperty(String name, String value)
name
- Property namevalue
- Property valuepublic void writeProperty(String name)
name
- Property namepublic void writeElement(String name, int type)
name
- Element nametype
- Element typepublic void writeText(String text)
text
- Text to appendpublic void writeData(String data)
data
- Data to appendpublic void writeXMLHeader()
public void sendData() throws IOException
IOException
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.