Win a copy of Rust Web Development this week in the Other Languages forum!

phil mitchel

Greenhorn
+ Follow
since Sep 10, 2008
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by phil mitchel

ah, ok think I got it: the compiler only sees the signature of the abstract method, it doesn't see that the CSVJoiner enum overides the getInstance method and returns the <File> so complains because <?> could be anything. Will look into the Typesafe enum suggested.

thanks for the help !
12 years ago
thanks Garrett - still a bit confused though:

The abstract method in the JoinerFactory enum declares that it returns a Joiner<?>,



- yep so isn't that saying, I'm going to return a Joiner of some type ?

in which case...

is retunring some type - in this case it happens to be of type <File>
- what am I missing here ?

I think from what you're syaing I can infer that <File> does not have an 'isa' relationship with <?> - is this correct ?
12 years ago
look into JAXB / JAX-WS, unmarshal your XML directly into the objects generated from xjc. you could wirte adaptors to wrap the generated classes to fit your needs or have constructors in your own classes that take the generated objects as args.

if don't already have a proper XSD, you can create the XSD on this site:
http://www.hitsw.com/xml_utilites/

run xjc from the command line, pass the XSD as an argument - or google how to add it as an extrnal tool in eclipse

here's some bare bones code I dug out to show how to marshal / unmarshal



rgds,
Phil
12 years ago
Hi all,

Hope I got the right forum - let me know if this is the wrong place.

Here's my problem: in the code below the Client has a compile time error:
Type mismatch: cannot convert from Joiner<capture#1-of ?> to Joiner<File>

My understanding of <?> is 'we don't know what type yet' so what I can't understand is why <file> can't be a type of <?>
By a similar token I've tried making hte return type of the abstract method in the enum factory <Object> - still won't work, you get compile time error in the enum factory that <File> is an incompatable return type.

Perhaps I'm missing some fundamental concept here but I've been googling it all day and I'm totally at a loss - can anyone explain this to me ??

Many thanks in advance.

Phil

12 years ago