Actually I think that what I was thinking about is something different.

class DefaultGeometry implements Expression {

  Object evaluate( Object object, Class context ) {
     List<PropertyAccessor> accessors = FactoryFinder.propertyAccessors(
object );
     for ( PropertyAccessor pa : accessors ) {
       List geometries = pa.geometries( object );
       return geomtetries.get( 0 );
     }
  }

}

Or something like that.

I like the empty xpath expression idea, but I don't see any reason not
to add it to the FeatureProeprtyAccessor as just an additional check.
Like that is where the check for "@gml:id" is. I think it makes most sense.

-Justin

Jody Garnett wrote:
> First of appologizes to Andrea for the confusion - we are talking about 
> capturing the idea of DefaultGeometry (not removing it).
> 
> In talking with Justin the following idea was brought up, rather then 
> add a PropertyAccessor method to getDefaultGeometry
> we should handle it as yet another PropertyAccessor implementation. That 
> is one that recognizes requests for xpath="" and target=Geometry.class.
> 
> BEFORE
> if( expression == null ){
>      geometry = feature.getDefaultGeometry();
> }
> else {
>      geometry = (Geometry) expression.evaulate( feature );
> }
> 
> AFTER
> if( expression == Expression.NULL ){
>     expression = DEFAULT_GEOMETRY;
> }
> geometry = DEFAULT_GEOMETRY.evaulate( obj, Geometry.class );
> 
> 
> Where the filter would make use of the following static final Expression
> 
> DEFAULT_GEOMETRY = ff.property( "" );
> 
> And a property accessor would be supplied to handle this case.
> 
> Justin I will start modifying these PropertyAccessor implementation to 
> allow for Geometry.class as a context - and hopefully you can get back 
> with the sanity check before it is commited.
> Cheers,
> Jody
> 
> -------------------------------------------------------------------------
> Take Surveys. Earn Cash. Influence the Future of IT
> Join SourceForge.net's Techsay panel and you'll get the chance to share your
> opinions on IT & business topics through brief surveys - and earn cash
> http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
> _______________________________________________
> Geotools-devel mailing list
> Geotools-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel
> 
> !DSPAM:1004,456b6ddb292807731818748!
> 


-- 
Justin Deoliveira
[EMAIL PROTECTED]
The Open Planning Project
http://topp.openplans.org

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to