com.partnersoft.formats.kml
Class KmlBuilder

java.lang.Object
  extended by com.partnersoft.formats.kml.KmlBuilder

public class KmlBuilder
extends java.lang.Object

Builder for generating Kml documents. Stores all objects to add to Kml document. Document isn't generated until generateKml is called.

Kml documentation can be found at http://code.google.com/apis/kml/ Made for Kml version 2.2

Copyright 2008 Partner Software

Version:
$Id$
Author:
Rich Stepanski

Constructor Summary
KmlBuilder()
          Creates a new KmlBuilder.
 
Method Summary
 void addObject(KmlObject object)
          Stores a KmlObject to be written into a Kml file.
 void clear()
          Erases all objects currently stored.
 java.lang.String generateKml()
          Generates a complete Kml document based on stored Kml objects.
 void generateKml(VfsFile file)
          Generates a complete Kml document based on stored Kml objects.
 void generateKml(java.io.Writer writer)
          Generates a complete Kml document based on stored Kml objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

KmlBuilder

public KmlBuilder()
Creates a new KmlBuilder.

Method Detail

addObject

public void addObject(KmlObject object)
Stores a KmlObject to be written into a Kml file.


clear

public void clear()
Erases all objects currently stored.


generateKml

public void generateKml(VfsFile file)
                 throws java.io.IOException
Generates a complete Kml document based on stored Kml objects.

Parameters:
file - - VfsFile to pump kml into.
Throws:
java.io.IOException - - thrown if some IO problem happens.

generateKml

public void generateKml(java.io.Writer writer)
                 throws java.io.IOException
Generates a complete Kml document based on stored Kml objects.

Parameters:
writer - - Writer to pump Kml into.
Throws:
java.io.IOException

generateKml

public java.lang.String generateKml()
                             throws java.io.IOException
Generates a complete Kml document based on stored Kml objects.

Returns:
- String containing Kml document.
Throws:
java.io.IOException