Solved

check if a field references a container class

Posted on 2004-10-15
6
198 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
Comment Utility
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
Comment Utility
Hi bcsmess,

More home work...?

Cheers!

\tt
0
 

Author Comment

by:bcsmess
Comment Utility
by check if one is java.util.collection, do i use instance of java.util.Collection?
0
How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

 
LVL 11

Expert Comment

by:cjjclifford
Comment Utility
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
Comment Utility
regarding how to check - did you read the javadoc that you posted? Its quite straightforward...
0
 
LVL 11

Expert Comment

by:cjjclifford
Comment Utility
... just use the interface name...
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
countX 22 68
IT Company 5 67
network + 7 72
Free Alternative to JIRA 4 51
For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:

762 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now