Package gov.nasa.worldwind
Interface Exportable
-
- All Known Subinterfaces:
AirspaceAttributes
,BalloonAttributes
,ShapeAttributes
- All Known Implementing Classes:
AbstractGeneralShape
,AbstractShape
,AntennaAxes
,AntennaModel
,BasicAirspaceAttributes
,BasicBalloonAttributes
,BasicShapeAttributes
,Box
,ColladaMeshShape
,Cone
,Cylinder
,DirectedPath
,DirectedSurfacePolyline
,Ellipsoid
,ExportableAnalyticSurface
,ExtrudedPolygon
,KMLExtrudedPolygonImpl
,KMLGroundOverlayPolygonImpl
,KMLLineStringPlacemarkImpl
,KMLPointPlacemarkImpl
,KMLPolygonImpl
,KMLScreenImageImpl
,KMLSurfaceImageImpl
,KMLSurfacePolygonImpl
,Path
,PointPlacemark
,PointPlacemarkAttributes
,Polygon
,Pyramid
,RadarVolume
,RigidShape
,ScreenCreditImage
,ScreenImage
,SectorSelector.RegionShape
,SurfaceImage
,SurfacePolygon
,SurfacePolyline
,SurfaceQuad
,SurfaceSector
,SurfaceSquare
,Wedge
public interface Exportable
Exportable marks an object that can be exported in different data formats. Implementing classes may support one or more export formats. Formats are identified by MIME type. CallisExportFormatSupported(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);
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
FORMAT_NOT_SUPPORTED
Returned byisExportFormatSupported(String)
if the object does not support export to the given format.static java.lang.String
FORMAT_PARTIALLY_SUPPORTED
Returned byisExportFormatSupported(String)
if the object contains some objects that support does not support export to the given format, but others that do not.static java.lang.String
FORMAT_SUPPORTED
Returned byisExportFormatSupported(String)
if the object does support export to the given format.
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
export(java.lang.String mimeType, java.lang.Object output)
Exports the object to a format.java.lang.String
isExportFormatSupported(java.lang.String mimeType)
Does this object support a certain export format?
-
-
-
Field Detail
-
FORMAT_SUPPORTED
static final java.lang.String FORMAT_SUPPORTED
Returned byisExportFormatSupported(String)
if the object does support export to the given format.- See Also:
- Constant Field Values
-
FORMAT_NOT_SUPPORTED
static final java.lang.String FORMAT_NOT_SUPPORTED
Returned byisExportFormatSupported(String)
if the object does not support export to the given format.- See Also:
- Constant Field Values
-
FORMAT_PARTIALLY_SUPPORTED
static final java.lang.String FORMAT_PARTIALLY_SUPPORTED
Returned byisExportFormatSupported(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.- See Also:
- Constant Field Values
-
-
Method Detail
-
isExportFormatSupported
java.lang.String isExportFormatSupported(java.lang.String mimeType)
Does this object support a certain export format?- Parameters:
mimeType
- Desired export format.- Returns:
- One of
FORMAT_SUPPORTED
,FORMAT_NOT_SUPPORTED
, orFORMAT_PARTIALLY_SUPPORTED
. - See Also:
export(String, Object)
-
export
void export(java.lang.String mimeType, java.lang.Object output) throws java.io.IOException, java.lang.UnsupportedOperationException
Exports the object to a format.- Parameters:
mimeType
- Desired export format. CallisExportFormatSupported(String)
to make sure that the object supports the format before trying to export, or be prepared to handleUnsupportedOperationException
.output
- Object that will receive the exported data. The type of this object depends on the export format. All formats should supportjava.io.OutputStream
. Text based format (for example, XML formats) should also supportjava.io.Writer
. Certain formats may also support other object types.- Throws:
java.io.IOException
- if an exception occurs while exporting the data.java.lang.UnsupportedOperationException
- if the format is not supported by this object, or if theoutput
argument is not of a supported type.- See Also:
isExportFormatSupported(String)
-
-