Class ReTypeFeatureReader

  • All Implemented Interfaces:
    Closeable, AutoCloseable, DelegatingFeatureReader<SimpleFeatureType,​SimpleFeature>, FeatureReader<SimpleFeatureType,​SimpleFeature>

    public class ReTypeFeatureReader
    extends Object
    implements DelegatingFeatureReader<SimpleFeatureType,​SimpleFeature>
    Supports on the fly retyping of FeatureReader contents.

    This may be used to have a DataStore work with your own representation of Feature information.

    Example Use:

    
      FeatureReader reader = dataStore.getFeatureReader( query, Transaction.AUTO_COMMIT );
     reader = new ReTypeFeatureReader( reader, myFeatureType );
     try {
       while( reader.hasNext() ){
         Feature f = reader.next();
         System.out.println( f );
       }
     }
     finally {
       reader.close(); // will close both
     }
     

    This Reader makes a simple one to one between the original schema and the target schema based on descriptor name.

    Author:
    Jody Garnett (Refractions Research)