The parser is also having trouble with casting Strings. For some types (e.g.
MetadataTypeType and StringOrRefType) it wants a String instead so I get a
ClassCastException. I tried changing the EMF objects using these types
manually and replacing MetadataTypeType with String, for example, but this
is getting a bit complicated.
I'm not even sure what some of the types are - why does EMF use
StringOrRefType when it can just use a String?
Is changing EMF classes manually the normal way of doing things? I'm
assuming that when it wants a a LonLatEnvelopeType when I've actually got a
GeneralEnvelope then I'd need to do this anyway. But what about these other
types (like StringOrRefType or enumerations like MetadataTypeType...).
Argh!
Jon
Jon Britton wrote:
>
> Hi,
>
> I'm still trying to parse the WCS Capabilities document using the existing
> EMF model. However, it seems to have trouble creating a RequestType
> object as in:
>
> <complexType name="WCSCapabilityType">
> <sequence>
> <element name="Request">
> <complexType>
> <sequence>
> <element name="GetCapabilities">
> <complexType>
> ...
>
> There is a GetCapabilitiesType1 class which corresponds to the
> GetCapabilities element above, but this doesn't seem to be getting called.
> Instead it thinks its a HashMap, so when RequestType's eSet() is called
> for the GetCapabilities element I get a ClassCastException:
>
> public void eSet(int featureID, Object newValue) {
> switch (featureID) {
> case Wcs10Package.REQUEST_TYPE__GET_CAPABILITIES:
> setGetCapabilities((GetCapabilitiesType1)newValue);
> <--ClassCastException, newValue is a HashMap, not a GetCapabilitiesType1!)
>
> I'm a bit confused as to how EMF determines what type an element
> corresponds to since I can't find anything which tells it to create a
> HashMap instead of a GetCapabilitiesType1. I'm not sure if that makes any
> sense, but if anyone can see what's going wrong I'd be greatful for some
> help!
>
> Thanks,
>
> Jon
>
--
View this message in context:
http://n2.nabble.com/Parsing-WCS-Capabilities-with-EMF---ClassCastExceptions-tp2739779p2794617.html
Sent from the geotools-gt2-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
The NEW KODAK i700 Series Scanners deliver under ANY circumstances! Your
production scanning environment may not be a perfect world - but thanks to
Kodak, there's a perfect scanner to get the job done! With the NEW KODAK i700
Series Scanner you'll get full speed at 300 dpi even with all image
processing features enabled. http://p.sf.net/sfu/kodak-com
_______________________________________________
Geotools-gt2-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/geotools-gt2-users