public org.omg.CORBA.EnumDef create_enum( java.lang.String id, java.lang.String name, java.lang.String version, java.lang.String[] members) { org.omg.CORBA.Request _request = this._request("create_enum"); _request.set_return_type(org.omg.CORBA.EnumDefHelper.type()); org.omg.CORBA.Any $id = _request.add_named_in_arg("id"); $id.insert_string(id); org.omg.CORBA.Any $name = _request.add_named_in_arg("name"); $name.insert_string(name); org.omg.CORBA.Any $version = _request.add_named_in_arg("version"); $version.insert_string(version); org.omg.CORBA.Any $members = _request.add_named_in_arg("members"); org.omg.CORBA.EnumMemberSeqHelper.insert($members, members); _request.invoke(); java.lang.Exception _exception = _request.env().exception(); if (_exception != null) { if (_exception instanceof org.omg.CORBA.UnknownUserException) { org.omg.CORBA.UnknownUserException _userException = (org.omg.CORBA.UnknownUserException) _exception; } throw (org.omg.CORBA.SystemException) _exception; } ; org.omg.CORBA.EnumDef _result; _result = org.omg.CORBA.EnumDefHelper.extract(_request.return_value()); return _result; }
/** print an IDL Enum */ public void printEnum(org.omg.CORBA.TypeDescription t, int indentation) { org.omg.CORBA.EnumDef e_def = org.omg.CORBA.EnumDefHelper.narrow(ir.lookup_id(t.id)); if (e_def != null) { String[] members = e_def.members(); indent(indentation); StringBuffer vals = new StringBuffer(); if (members.length > 0) vals.append(members[0]); for (int i = 1; i < members.length; i++) { vals.append("," + members[i]); } print("enum " + e_def.name() + " {" + vals + "};" + "\n\n"); } else { logger.error("Error, could not find enum " + t.id + " in IR "); } }