Search...
FAQs
Subscribe
Pie
FAQs
Recent topics
Flagged topics
Hot topics
Best topics
Search...
Search within Java in General
Search Coderanch
Advance search
Google search
Register / Login
Post Reply
Bookmark Topic
Watch Topic
New Topic
programming forums
Java
Mobile
Certification
Databases
Caching
Books
Engineering
Micro Controllers
OS
Languages
Paradigms
IDEs
Build Tools
Frameworks
Application Servers
Open Source
This Site
Careers
Other
Pie Elite
all forums
this forum made possible by our volunteer staff, including ...
Marshals:
Campbell Ritchie
Jeanne Boyarsky
Ron McLeod
Paul Clapham
Liutauras Vilda
Sheriffs:
paul wheaton
Rob Spoor
Devaka Cooray
Saloon Keepers:
Stephan van Hulst
Tim Holloway
Carey Brown
Frits Walraven
Tim Moores
Bartenders:
Mikalai Zaikin
Forum:
Java in General
javaparser generic method
Miro Malac
Greenhorn
Posts: 1
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Can I parse generic method with javaparser ?? If its possible so how? For example this is my method:
public static < E > void printArray( E[] inputArray ) { // Display array elements for ( E element : inputArray ){ System.out.printf( "%s ", element ); } System.out.println(); }
When I parse with MethodVisitor and use MethodVisitor.getParameters().getType I get E[] but I need to get that it is Object. It is posible?
Liutauras Vilda
Marshal
Posts: 8857
637
I like...
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Use List class for such a problems, ArrayList or LinkedList and then iterator().
Read about it, I hope it will be clear.
Campbell Ritchie
Marshal
Posts: 79179
377
posted 9 years ago
Number of slices to send:
Optional 'thank-you' note:
Send
Welcome to the Ranch
Yes, I am sure you can, but
you should
start with the handbook for your application or its tutorials. I fail to see what Lists have to do with it.
You can't have everything. Where would you put it?
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
reply
Bookmark Topic
Watch Topic
New Topic
Boost this thread!
Similar Threads
Generic Interface Example
to print intege value of generic
Deep cloning not working
Generics doubt
Overloading doubt
More...