public interface Exportable
isExportFormatSupported(String) to determine
if an object supports export in a certain format.
Example of use:
// Export a PointPlacemark in KML format PointPlacemark placemark; StringWriter kml = new StringWriter(); placemark.export(KMLConstants.KML_MIME_TYPE, kml);
| Modifier and Type | Field and Description |
|---|---|
static String |
FORMAT_NOT_SUPPORTED
Returned by
isExportFormatSupported(String) if the object does not support export to the given format. |
static String |
FORMAT_PARTIALLY_SUPPORTED
Returned by
isExportFormatSupported(String) if the object contains some objects that support does not
support export to the given format, but others that do not. |
static String |
FORMAT_SUPPORTED
Returned by
isExportFormatSupported(String) if the object does support export to the given format. |
| Modifier and Type | Method and Description |
|---|---|
void |
export(String mimeType,
Object output)
Exports the object to a format.
|
String |
isExportFormatSupported(String mimeType)
Does this object support a certain export format?
|
static final String FORMAT_NOT_SUPPORTED
isExportFormatSupported(String) if the object does not support export to the given format.static final String FORMAT_PARTIALLY_SUPPORTED
isExportFormatSupported(String) if the object contains some objects that support does not
support export to the given format, but others that do not. For example, a Layer might contain some objects that
support the export format, and some that do not.static final String FORMAT_SUPPORTED
isExportFormatSupported(String) if the object does support export to the given format.void export(String mimeType, Object output) throws IOException, UnsupportedOperationException
mimeType - Desired export format. Call isExportFormatSupported(String) to make sure that the object
supports the format before trying to export, or be prepared to handle UnsupportedOperationException.output - Object that will receive the exported data. The type of this object depends on the export format.
All formats should support java.io.OutputStream. Text based format (for example, XML
formats) should also support java.io.Writer. Certain formats may also support other
object types.IOException - if an exception occurs while exporting the data.UnsupportedOperationException - if the format is not supported by this object, or if the output
argument is not of a supported type.isExportFormatSupported(String)String isExportFormatSupported(String mimeType)
mimeType - Desired export format.FORMAT_SUPPORTED, FORMAT_NOT_SUPPORTED, or FORMAT_PARTIALLY_SUPPORTED.export(String, Object)