Problem Referencing Nested Inner Classes [message #786644] |
Mon, 30 January 2012 12:11  |
Eclipse User |
|
|
|
I was given a jar file to reference in my project that has the following class/inner class/inner class structure:
package externalJarFile;
public class Job
{
public static class GlobalVars
{
private List<Job.GlobalVars.Variable> variables;
public List<Job.GlobalVars.Variable> getVariable()
{
if (this.variables == null) {
this.variables = new ArrayList<Job.GlobalVars.Variable>();
}
return this.variables;
}
public static class Variable
{
String name;
String value;
public String getName() { return name; }
public void setName( String name ) { this.name = name; }
public String getValue() { return value; }
public void setValue( String value) { this.value= value; }
}
}
}
The problem I'm having is that I need to populate the "Job.GlobalVars" list, but I can't figure out how to reference the "Variables" type. Whenever I add:
import externalJarFile.Job.GlobalVars.Variable;
I get a compilation error that the type "externalJarFile.Job.GlobalVars.Variable" cannot be referenced. How can I create a new "Variable" instance to add to the "GlobalVars.getVariable()" list?
Here's a snippet that I tried (but didn't work):
Job.GlobalVars vars = new Job.GlobalVars();
Job.GlobalVars.Variable v = new Job.GlobalVars.Variable();
I'm concerned that this is an issue with the Eclipse editor as this code works as expected in JDeveloper, but we are trying to move away from JDev for a number of reasons. Any help would be greatly appreciated.
Sincerely,
Peter
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.34255 seconds