org.progeeks.geo.esri
Class MetaObjectShapeWriter

java.lang.Object
  extended by org.progeeks.geo.esri.MetaObjectShapeWriter

public class MetaObjectShapeWriter
extends java.lang.Object

This writes out a generic MetaObject out as an ESRI shape file. The MetaObject must consist of all simple concrete types and a single MetaClassPropertyType of ersi.shape. Currently handled types: Integer, Long, Short, Float, Double, Character Byte, Boolean, Date, Calendar, GregorianCalendar, String, esri.shape

Author:
Steve Ingram

Constructor Summary
MetaObjectShapeWriter(MetaClass metaClass, java.lang.String name, int shapeType)
          Creates a writer, note that the name can contain a leading path and should end in .shp.
 
Method Summary
 void close()
          Closes the writers and files
 EsriShapeResource getResource()
           
 java.lang.String getShapeProp()
           
 void write(MetaObject metaObject)
          Add the MetaObject to the output files.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MetaObjectShapeWriter

public MetaObjectShapeWriter(MetaClass metaClass,
                             java.lang.String name,
                             int shapeType)
Creates a writer, note that the name can contain a leading path and should end in .shp. Two additinal files will be created using the passed name, substituting .dbf and .shx for .shp The MetaClass should contain a property of type esri.shape to create shape files.

Parameters:
metaClass - MetaClass to be contained in the shape file
name - Name fo the shape file including leading path and trailing .shp
shapeType - Esri shape type of the file
Throws:
java.lang.IllegalArgumentException - on errors mapping MetaClass fields
java.lang.RuntimeException - on errors creating files and writers
Method Detail

write

public void write(MetaObject metaObject)
Add the MetaObject to the output files. This MetaObject must be of the same type that was used to create this writer.

Parameters:
metaObject -
Throws:
java.lang.IllegalArgumentException - if the MetaObject is not of the original MetaClass type
java.lang.RuntimeException - on IO errors writing files

close

public void close()
Closes the writers and files

Throws:
java.lang.RuntimeException - on IO errors closing the files

getResource

public EsriShapeResource getResource()
Returns:
Returns the resource.

getShapeProp

public java.lang.String getShapeProp()
Returns:
Returns the shapeInfo.


Copyright © 2002-2003 Paul Speed. All Rights Reserved.