Package eu.europa.ec.taxud.cesop.writers
Class CesopXmlWriter<T extends OutputStream>
- java.lang.Object
-
- eu.europa.ec.taxud.cesop.writers.CesopXmlWriter<T>
-
- All Implemented Interfaces:
AutoCloseable
- Direct Known Subclasses:
ValidationMessageXmlWriter
public class CesopXmlWriter<T extends OutputStream> extends Object implements AutoCloseable
Utils class to write XML files.
-
-
Constructor Summary
Constructors Constructor Description CesopXmlWriter(T outputStream)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
protected void
flush()
T
getOutputStream()
Returns the output stream.protected void
writeAttribute(String name, String value)
protected void
writeBoolean(boolean value)
protected void
writeEndElement()
protected void
writeEOL()
protected void
writeIndentIfNeeded()
protected void
writeInteger(Integer value)
protected void
writeLong(Long value)
protected void
writeNamespace()
protected void
writeStartDocument()
protected void
writeStartElement(String localName)
protected void
writeStartElement(QName qName)
protected void
writeTag(String localName, Integer value)
protected void
writeTag(String localName, Long value)
protected void
writeTag(String localName, String value)
protected void
writeTag(QName qName, boolean value)
protected void
writeTag(QName qName, Integer value)
protected void
writeTag(QName qName, String value)
protected void
writeTagIfNotEmpty(String localName, Integer value)
protected void
writeTagIfNotEmpty(String localName, String value)
protected void
writeTagWithAttributes(QName qName, String value, Map<String,String> attributes)
protected void
writeText(String characters)
-
-
-
Constructor Detail
-
CesopXmlWriter
public CesopXmlWriter(T outputStream) throws XMLStreamException
Constructor.- Parameters:
outputStream
- the output stream- Throws:
XMLStreamException
- in case of exception
-
-
Method Detail
-
writeNamespace
protected void writeNamespace() throws XMLStreamException
- Throws:
XMLStreamException
-
writeStartDocument
protected void writeStartDocument() throws XMLStreamException
- Throws:
XMLStreamException
-
writeTag
protected void writeTag(QName qName, String value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeAttribute
protected void writeAttribute(String name, String value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTagWithAttributes
protected void writeTagWithAttributes(QName qName, String value, Map<String,String> attributes) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTag
protected void writeTag(QName qName, boolean value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTag
protected void writeTag(QName qName, Integer value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTagIfNotEmpty
protected void writeTagIfNotEmpty(String localName, String value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTagIfNotEmpty
protected void writeTagIfNotEmpty(String localName, Integer value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTag
protected void writeTag(String localName, String value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTag
protected void writeTag(String localName, Integer value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeTag
protected void writeTag(String localName, Long value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeStartElement
protected void writeStartElement(QName qName) throws XMLStreamException
- Throws:
XMLStreamException
-
writeStartElement
protected void writeStartElement(String localName) throws XMLStreamException
- Throws:
XMLStreamException
-
writeEndElement
protected void writeEndElement() throws XMLStreamException
- Throws:
XMLStreamException
-
writeText
protected void writeText(String characters) throws XMLStreamException
- Throws:
XMLStreamException
-
writeBoolean
protected void writeBoolean(boolean value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeInteger
protected void writeInteger(Integer value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeLong
protected void writeLong(Long value) throws XMLStreamException
- Throws:
XMLStreamException
-
writeEOL
protected void writeEOL() throws XMLStreamException
- Throws:
XMLStreamException
-
writeIndentIfNeeded
protected void writeIndentIfNeeded() throws XMLStreamException
- Throws:
XMLStreamException
-
flush
protected void flush() throws XMLStreamException
- Throws:
XMLStreamException
-
getOutputStream
public T getOutputStream()
Returns the output stream.- Returns:
- the output stream.
-
close
public void close() throws XMLStreamException, IOException
- Specified by:
close
in interfaceAutoCloseable
- Throws:
XMLStreamException
IOException
-
-