public Element makeEnumTypedefElement(EnumTypedef etd) {
    Element typeElem = new Element("enumTypedef", namespace);
    typeElem.setAttribute("name", etd.getShortName());
    typeElem.setAttribute("type", etd.getBaseType().toString());

    // Use a TreeMap so that the key-value pairs are emitted in a consistent order.
    TreeMap<Integer, String> map = new TreeMap<>(etd.getMap());

    for (Map.Entry<Integer, String> entry : map.entrySet()) {
      typeElem.addContent(new Element("enum", namespace)
              .setAttribute("key", Integer.toString(entry.getKey()))
              .addContent(entry.getValue()));
    }

    return typeElem;
  }
public Element makeEnumTypedefElement ( EnumTypedef etd ) { Element typeElem = new Element ( "enumTypedef" , namespace ) ; typeElem . setAttribute ( "name" , etd . getShortName ( ) ) ; typeElem . setAttribute ( "type" , etd . getBaseType ( ) . toString ( ) ) ; TreeMap < Integer , String > map = new TreeMap < > ( etd . getMap ( ) ) ; for ( Map . Entry < Integer , String > entry : map . entrySet ( ) ) { typeElem . addContent ( new Element ( "enum" , namespace ) . setAttribute ( "key" , Integer . toString ( entry . getKey ( ) ) ) . addContent ( entry . getValue ( ) ) ) ; } return typeElem ; }
enum Typedef