Reputation: 809
I'm having some issues referencing a specific enum within a class file.
This class file contains multiple enums. It looks like the following:
public class MyEnumContainer { static enum MyEnum1 { ... } static enum MyEnum2 { ... } : : }
Here is my reference to the example above: Multiple Enums in a Single Class
I'm using this in an XML file. The reference is used in the <type>
tag in a <setting>
tag.
I currently have a reference to the MyEnumContainer. It looks like the following:
<type>MyEnumContainer</type>
.
I've tried using <type>MyEnumContainer.MyEnum1</type>
and <type>MyEnumContainer$MyEnum1</type>
but the reference was not recognized.
Note: the software that processes this XML is fully functional. I only need to know how to properly reference a specific enum within a class file.
Upvotes: 0
Views: 232
Reputation: 334
Your real problem is how your XML parser interprets the value in <type>. If it does not know how to get an enum from within a class, then there is nothing you can do. On the other hand, it may know how to get at the enum, but uses some arcane delimiter to separate the class name from the enum name. So
<type>MyEnumContainer#MyEnum1</type>
<type>MyEnumContainer*MyEnum1</type>
or
<type>MyEnumContainer(MyEnum1)</type>
<type>MyEnumContainer[MyEnum1]</type>
or
<type enum="MyEnum1">MyEnumContainer</type>
<type inner="MyEnum1">MyEnumContainer</type>
or maybe even
<type-enum>MyEnumContainer.MyEnum1</type-enum>
Of course it could also be
<type>com.company.project.tools.MyEnumContainer.MyEnum1</type>
<type package="com.company.project.tools">MyEnumContainer.MyEnum1</type>
let your imagination run wild...
Upvotes: 1