Make ASMDataTable more useful: (#2911)

- EnumHolder now has getters for it's data
- enum arrays work now
- nested annotations work now outside of being in arrays
This commit is contained in:
diesieben07 authored and cpw committed 2016-06-22 22:40:27 -04:00
1 parent ce481da1d1
commit f10f7502c8
1 file changed
+13 -7
@@ -27,8 +27,8 @@ public class ModAnnotation
{ {
public class EnumHolder public class EnumHolder
{ {
private String desc; private final String desc;
private String value; private final String value;
public EnumHolder(String desc, String value) public EnumHolder(String desc, String value)
{ {
@@ -36,6 +36,15 @@ public class ModAnnotation
this.value = value; this.value = value;
} }
public String getDesc()
{
return desc;
}
public String getValue()
{
return value;
}
} }
AnnotationType type; AnnotationType type;
Type asmType; Type asmType;
@@ -100,7 +109,7 @@ public class ModAnnotation
public void addEnumProperty(String key, String enumName, String value) public void addEnumProperty(String key, String enumName, String value)
{ {
values.put(key, new EnumHolder(enumName, value)); addProperty(key, new EnumHolder(enumName, value));
} }
public void endArray() public void endArray()
@@ -111,10 +120,7 @@ public class ModAnnotation
public ModAnnotation addChildAnnotation(String name, String desc) public ModAnnotation addChildAnnotation(String name, String desc)
{ {
ModAnnotation child = new ModAnnotation(AnnotationType.SUBTYPE, Type.getType(desc), this); ModAnnotation child = new ModAnnotation(AnnotationType.SUBTYPE, Type.getType(desc), this);
if (arrayList != null) addProperty(name, child.getValues());
{
arrayList.add(child.getValues());
}
return child; return child;
} }
} }