Solved

check if a field references a container class

Posted on 2004-10-15
6
226 Views
Last Modified: 2010-03-31
How do you check if a field references a container class - that points to a reference collection?

**If possible, use the following BCEL API
http://jakarta.apache.org/bcel/apidocs/index.html

0
Comment
Question by:bcsmess
  • 4
6 Comments
 
LVL 11

Accepted Solution

by:
cjjclifford earned 400 total points
ID: 12320702
BECL specific - get the JavaClass for an instance of the Field you are interested in, use getAllInterfaces() to get all the interfaces, and check if one is java.util.Collection.

Can I ask what you are trying to do using BCEL - you have several open questions all around the same area, perhaps if you post a question about the overall problems/program you are trying to work with, people here might be in a better position to suggest solutions...
0
 
LVL 14

Expert Comment

by:Tommy Braas
ID: 12320718
Hi bcsmess,

More home work...?

Cheers!

\tt
0
 

Author Comment

by:bcsmess
ID: 12320904
by check if one is java.util.collection, do i use instance of java.util.Collection?
0
Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 11

Expert Comment

by:cjjclifford
ID: 12321223
can you answer my query about what you are trying to do overall (or is this homework as orangehead asks, in multiple questions...)
0
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12321240
regarding how to check - did you read the javadoc that you posted? Its quite straightforward...
0
 
LVL 11

Expert Comment

by:cjjclifford
ID: 12321247
... just use the interface name...
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Protect jar file - windows app 2 65
jar file executable 12 58
hibernate jars 4 45
Tagging and Merging on Branch 1 29
For customizing the look of your lightweight component and making it look lucid like it was made of glass. Or: how to make your component more Apple-ish ;) This tip assumes your component to be of rectangular shape and completely opaque. (COD…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
This video teaches viewers about errors in exception handling.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question