Thank you Justin, I think I'll have to change the cast from Association to 
Property (credit to Ben), as both ComplexAttribute and Association extend from 
it. I might also have to implement an encode method for this binding. I'll 
create a JIRA entry when I'm finished with this. 

-----Original Message-----
From: Justin Deoliveira [mailto:jdeol...@opengeo.org] 
Sent: Friday, 15 May 2009 8:09 PM
To: Angreani, Rini (E&M, Kensington)
Cc: geotools-devel@lists.sourceforge.net
Subject: Re: [Geotools-devel] ReferenceTypeBinding

Hi Rini,

This behavior is used by jdbc-ng, in order to support a very lame 
implementation of xlink. If you look at JDBCFetureReader in that module 
you will, although I warn you, the method is nasty :).

That said, what you see there is pretty much a hack. One I would be ok 
with letting die.

-Justin

rini.angre...@csiro.au wrote:
> Hi list,
>  
> I guess this question goes to Justin, since he's the author of the 
> class. I have a problem with gml:ReferenceType, with a 
> ClassCastException in ReferenceTypeBinding:
>  
> * *
> 
> *public* Object getProperty(Object object, QName name)
> 
> *throws* Exception {
> 
> Association association = (Association) object;
> 
> //non resolveed, return the xlink:href
> 
> *if* (XLINK./HREF/.equals(name)) {
> 
> String id = (String) association.getUserData().get("gml:id");
> 
> *return* "#" + id;
> 
> }
> 
> *return* *null*;
> 
> }
> 
> The object I have is a ComplexAttribute, and the expected object is an 
> Association. I can't find any examples of this being used anywhere? Why 
> does it have to be an Association object, and I can't find any converter 
> for it. Maybe I didn't search hard enough.. and I've never dealt with 
> this type before. If anyone can shed a light on how to use this, it'd be 
> much appreciated.
> 
>  
> 
> Cheers
> 
> Rini
> 
> 
> ------------------------------------------------------------------------
> 
> ------------------------------------------------------------------------------
> Crystal Reports - New Free Runtime and 30 Day Trial
> Check out the new simplified licensing option that enables 
> unlimited royalty-free distribution of the report engine 
> for externally facing server and web deployment. 
> http://p.sf.net/sfu/businessobjects
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Geotools-devel mailing list
> Geotools-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/geotools-devel


-- 
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

------------------------------------------------------------------------------
Crystal Reports - New Free Runtime and 30 Day Trial
Check out the new simplified licensing option that enables 
unlimited royalty-free distribution of the report engine 
for externally facing server and web deployment. 
http://p.sf.net/sfu/businessobjects
_______________________________________________
Geotools-devel mailing list
Geotools-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geotools-devel

Reply via email to