Solved

check if a field references a container class

Posted on 2004-10-15
6
221 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
Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

 
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

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
nextBoolean(double p) for Random class 3 40
type mismatch (Object[] to double[] 4 24
runtime exception 2 28
JavaFX TableView not displaying correctly 3 18
Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Introduction This article is the last of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers our test design approach and then goes through a simple test case example, how …
Viewers learn about the third conditional statement “else if” and use it in an example program. Then additional information about conditional statements is provided, covering the topic thoroughly. Viewers learn about the third conditional statement …
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

770 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