public class KMZDocumentBuilder
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected javax.xml.stream.XMLStreamWriter |
writer |
protected java.util.zip.ZipOutputStream |
zipStream |
Constructor and Description |
---|
KMZDocumentBuilder(java.io.OutputStream stream)
Create a KMZ document using an OutputStream.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Close the document builder.
|
protected void |
endDocument()
End the KMZ document.
|
protected java.lang.String |
getMainFileName()
Get the name of the KML file inside of the KMZ archive.
|
protected void |
startDocument()
Start the KMZ document and write namespace declarations.
|
void |
writeObject(Exportable exportable)
Write an
Exportable object to the document. |
void |
writeObjects(Exportable... exportables)
Write a list of
Exportable objects to the document. |
protected javax.xml.stream.XMLStreamWriter writer
protected java.util.zip.ZipOutputStream zipStream
public KMZDocumentBuilder(java.io.OutputStream stream) throws javax.xml.stream.XMLStreamException, java.io.IOException
stream
- Stream to receive KMZ output.javax.xml.stream.XMLStreamException
- If an exception is encountered while writing KML.java.io.IOException
- If an exception occurs writing to the output stream.public void close() throws javax.xml.stream.XMLStreamException, java.io.IOException
javax.xml.stream.XMLStreamException
- If an error is encountered while writing KML.java.io.IOException
- If an exception occurs closing the output stream.protected void endDocument() throws javax.xml.stream.XMLStreamException, java.io.IOException
javax.xml.stream.XMLStreamException
- If an error is encountered while writing KML.java.io.IOException
- If an exception occurs writing to the output stream.protected java.lang.String getMainFileName()
protected void startDocument() throws javax.xml.stream.XMLStreamException, java.io.IOException
javax.xml.stream.XMLStreamException
- If an error is encountered while writing KML.java.io.IOException
- If an exception occurs writing to the output stream.public void writeObject(Exportable exportable) throws java.io.IOException
Exportable
object to the document. If the object does not support export in
KML format, it will be ignored.exportable
- Object to export in KML.java.io.IOException
- If an error is encountered while writing KML.public void writeObjects(Exportable... exportables) throws java.io.IOException
Exportable
objects to the document. If any objects do not support export in KML format,
they will be ignored.exportables
- List of objects to export in KML.java.io.IOException
- If an error is encountered while writing KML.