• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 259
  • Last Modified:

check if a field references a container class

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
bcsmess
Asked:
bcsmess
  • 4
1 Solution
 
cjjcliffordCommented:
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
 
Tommy BraasCommented:
Hi bcsmess,

More home work...?

Cheers!

\tt
0
 
bcsmessAuthor Commented:
by check if one is java.util.collection, do i use instance of java.util.Collection?
0
Cloud Class® Course: Microsoft Exchange Server

The MCTS: Microsoft Exchange Server 2010 certification validates your skills in supporting the maintenance and administration of the Exchange servers in an enterprise environment. Learn everything you need to know with this course.

 
cjjcliffordCommented:
can you answer my query about what you are trying to do overall (or is this homework as orangehead asks, in multiple questions...)
0
 
cjjcliffordCommented:
regarding how to check - did you read the javadoc that you posted? Its quite straightforward...
0
 
cjjcliffordCommented:
... just use the interface name...
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now