org.geotools.data.property
Class PropertyAttributeReader

Object
  extended by PropertyAttributeReader
All Implemented Interfaces:
AttributeReader

public class PropertyAttributeReader
extends Object
implements AttributeReader

Simple AttributeReader that works against Java properties files.

This AttributeReader is part of the geotools2 DataStore tutorial, and should be considered a Toy.

The content of this file should start with a the property "_" with the value being the typeSpec describing the featureType. Thereafter each line will should have a FeatureID as the property and the attribtues as the value separated by | characters.


 _=id:Integer|name:String|geom:Geometry
 fid1=1|Jody|well known text
 fid2=2|Brent|well known text
 fid3=3|Dave|well known text
 

May values may be represented by a special tag: . An empty element: || is interprested as the empty string:

  
  fid4=4|| -> Feature( id=2, name="", geom=null )
  

Author:
jgarnett
Module:
modules/plugin/property (gt-property.jar)

Constructor Summary
PropertyAttributeReader(File file)
          Creates a new PropertyAttributeReader object.
 
Method Summary
 void close()
          DOCUMENT ME!
 int getAttributeCount()
          DOCUMENT ME!
 AttributeDescriptor getAttributeType(int index)
          DOCUMENT ME!
 String getFeatureID()
          DOCUMENT ME!
 boolean hasNext()
          DOCUMENT ME!
 void next()
          DOCUMENT ME!
 Object read(int index)
          DOCUMENT ME!
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PropertyAttributeReader

public PropertyAttributeReader(File file)
                        throws IOException
Creates a new PropertyAttributeReader object.

Parameters:
file - DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!
Method Detail

getAttributeCount

public int getAttributeCount()
DOCUMENT ME!

Specified by:
getAttributeCount in interface AttributeReader
Returns:
DOCUMENT ME!

getAttributeType

public AttributeDescriptor getAttributeType(int index)
                                     throws ArrayIndexOutOfBoundsException
DOCUMENT ME!

Specified by:
getAttributeType in interface AttributeReader
Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
ArrayIndexOutOfBoundsException - DOCUMENT ME!

close

public void close()
           throws IOException
DOCUMENT ME!

Specified by:
close in interface AttributeReader
Throws:
IOException - DOCUMENT ME!

hasNext

public boolean hasNext()
                throws IOException
DOCUMENT ME!

Specified by:
hasNext in interface AttributeReader
Returns:
DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!

next

public void next()
          throws IOException
DOCUMENT ME!

Specified by:
next in interface AttributeReader
Throws:
IOException - DOCUMENT ME!
NoSuchElementException - DOCUMENT ME!

getFeatureID

public String getFeatureID()
DOCUMENT ME!

Returns:
DOCUMENT ME!

read

public Object read(int index)
            throws IOException,
                   ArrayIndexOutOfBoundsException
DOCUMENT ME!

Specified by:
read in interface AttributeReader
Parameters:
index - DOCUMENT ME!
Returns:
DOCUMENT ME!
Throws:
IOException - DOCUMENT ME!
ArrayIndexOutOfBoundsException - DOCUMENT ME!
DataSourceException - DOCUMENT ME!


Copyright © 1996-2009 Geotools. All Rights Reserved.