Ben Caradoc-Davies wrote:
> Ben Caradoc-Davies wrote:
>> (3) How do I write a binding for GML types whose name is not known at
>> compile time? In my earlier example GeologicFeaturePropertyType is a
>> complex type defined in an application schema.
>
> Please correct me if I am wrong, but my understanding is that it is the
> responsibility of a binding to extract the properties that are the
> immediate children of the object being processed. If I had a different
> binding for GML.AbstractFeatureType this still would not help me,
> because, because it would be obliged to return the
> GeologicFeaturePropertyType property, and not extract the properties of
> its children (grandchildren of the feature). The case I mentioned earlier:
>
> gsml:MappedFeature/gsml:specification/gsml:GeologicUnit
>
> - gsml:specification is of gsml:GeologicFeaturePropertyType
>
> - gsml:GeologicFeaturePropertyType contains an element
> ref="gsml:GeologicFeature"
>
> - gsml:GeologicUnit is in the substitution group for gsml:GeologicFeature
>
> Is a binding processing gsml:MappedFeature allowed to return tuples
> Object[] {particle, value}
> for properties of its own properties (its grandchildren)? Or would this
> cause these to be encoded as if they were its own children?
Ahh, excuse me, you are just dealing with encoding, not parsing.
Apologies. However, the general approach remains in tact and the hard
work will be done by AbstractFeatureTypeBinding (AFTB)
In the case you mention:
The first thing that happens AFTB is passed the MappedFeature (MF)
instance, and asked for its properties. The binding looks at the MF
instance, and finds the specification property. It knows (because it has
the schema for MF around) that this specification is of type
FeaturePropertyType (FPT), so it returns the (particle, value) pair:
(some particle with type FPT, the value of the referenced feature)
The value of the referenced feature being the instance of GeologicUnit (GU).
So with the (FPT,GU) tuple returned, the binding for FeaturePropertyType
is up next, and it will be asked for its properties being passed in the
GU feature. This binding is simple (assuming that you don't support any
of the crazy xlink resolving and all of that). It always just returns
the value passed into it when asked for its GML._Feature property. So
the tuple it returns is:
(some particle with type that extends from AbstractFeatureType, the GU
feature)
This puts AFTB back on the stack to be next up. This time it is passed
in GU, and it does the same deal it did for MappedFeature. Introspects
the feature instance returning all the properties. If any of those
properties are feature references, the process continues recursively and
so on.
I know this is pretty complex, apologies if my explanation does not make
any sense.
>
> Regards,
>
--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Geotools-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-devel