Solved

check if a field references a container class

Posted on 2004-10-15
6
237 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

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.

Question has a verified solution.

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

Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…

717 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