Go Back   Velocity Reviews > Newsgroups > Java
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

Java - How would you invoke arrayList.get() through reflection in 1.4 ??

 
Thread Tools Search this Thread
Old 11-07-2009, 03:12 AM   #11
Default Re: How would you invoke arrayList.get() through reflection in 1.4 ??


In article <hd2j1t$sfj$>,
markspace <> wrote:

> Lew wrote:
>
> >
> > you probably also needed "-target 1.4" and perhaps even

>
> I had that, it didn't seem to work either.
>
> Under Properties -> Libraries, there's a "Java Platform" drop down menu.
> I don't have Java 1.4 installed, so I can't check, but I'm going to
> guess that switching that menu will enable NetBeans to use a different
> JDK and also set the -target flag correctly.


I was similarly stymied for a time in NetBeans 6.5. On my machine, Java
1.5 is the default; I had to add 1.4.2 and 1.6 in the Tools -> Java
Platforms dialog. Even after making 1.6 available, I couldn't change
Properties -> Source/Binary Format to JDK 6 until I first set Properties
-> Libraries -> Java Platform to JDK 1.6.

--
John B. Matthews
trashgod at gmail dot com
<http://sites.google.com/site/drjohnbmatthews>


John B. Matthews
  Reply With Quote
Old 11-09-2009, 07:20 AM   #12
Roedy Green
 
Posts: n/a
Default Re: How would you invoke arrayList.get() through reflection in 1.4 ??
On Thu, 5 Nov 2009 06:47:16 -0800 (PST), Sébastien de Mapias
<> wrote, quoted or indirectly quoted someone who
said :

>if (method.getReturnType().toString().equals("interfa ce
>java.util.List"))

if you know at compile time you are looking for a java.util.List
interface object, you don't need reflection or anything fancy. Just
do a Class.forName and cast to a (List) or use generics to cast it for
you. You can then use a List ref to access all the methods of List
in a straightforward way.

--
Roedy Green Canadian Mind Products
http://mindprod.com

Without deviation from the norm, progress is not possible.
~ Frank Zappa (born: 1940-12-21 died: 1993-12-04 at age: 52)


Roedy Green
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reflection Mutiple Promts rmoneype Software 0 05-08-2008 01:49 AM
Attachmate / WRQ Reflection Macro Errors John Computer Information 0 12-12-2006 10:12 PM
looking for another way to invoke "scan for hardware changes" Jack B. Pollack Computer Support 3 11-15-2005 01:56 AM
gospel and reflection neil20002us@yahoo.com Computer Support 1 08-16-2005 01:08 AM
gospel and reflection neil20002us@yahoo.com Computer Support 1 08-16-2005 12:31 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46