public FullInterfaceDescription describe_interface()
{
if ( ! defined)
{
throw new INTF_REPOS ("InterfaceDef " + name + " not defined.");
}
if( fullDescription == null )
{
String def_in = "IDL:Global:1.0";
if( defined_in instanceof org.omg.CORBA.Contained )
def_in = ((org.omg.CORBA.Contained)defined_in).id();
/* before assembling descriptions, get hold of all super
types' FullInterfaceDescriptions */
FullInterfaceDescription [] baseDescriptions =
new FullInterfaceDescription[ base_interfaces().length ];
for( int b = 0; b < base_interfaces.length; b++ )
{
baseDescriptions[b] = base_interfaces[b].describe_interface();
}
/* build operation descriptions */
Hashtable ops = new Hashtable();
for( int c = 0; c < op_defs.length; c++ )
{
OperationDescription operation = op_defs[c].describe_operation();
ops.put( operation.name, operation );
}
/* get operation descriptions from super types, potentially duplicate
descriptions due to diamond inheritance are removed by hashing
*/
for( int baseOps = 0; baseOps < baseDescriptions.length; baseOps++ )
{
for( int bbaseOps = 0;
bbaseOps < baseDescriptions[baseOps].operations.length;
bbaseOps++ )
{
OperationDescription base_op =
baseDescriptions[baseOps].operations[bbaseOps];
if( !ops.containsKey( base_op.name ))
ops.put( base_op.name, base_op );
}
}
operations = new OperationDescription[ ops.size() ];
int opsCount = 0;
for( Enumeration e = ops.elements(); e.hasMoreElements(); opsCount++ )
{
operations[ opsCount ] = (OperationDescription)e.nextElement();
}
ops.clear();
/* build attribute descriptions */
Hashtable atts = new Hashtable();
for( int a = 0; a < att_defs.length; a++ )
{
AttributeDescription att = att_defs[a].describe_attribute();
atts.put( att.name, att );
}
/* get attribute descriptions from super types */
for( int baseAtts = 0; baseAtts < baseDescriptions.length; baseAtts++ )
{
for( int bbaseAtts = 0;
bbaseAtts < baseDescriptions[ baseAtts ].attributes.length;
bbaseAtts++ )
{
AttributeDescription base_att =
baseDescriptions[ baseAtts ].attributes[ bbaseAtts ];
if( !atts.containsKey( base_att.name ))
atts.put( base_att.name, base_att );
}
}
attributes = new AttributeDescription[ atts.size() ];
int attsCount = 0;
for( Enumeration e = atts.elements(); e.hasMoreElements(); attsCount++ )
{
attributes[ attsCount ] = (AttributeDescription)e.nextElement();
}
atts.clear();
/* build constant descriptions */
constants = new org.omg.CORBA.ConstantDescription[ constant_defs.length ];
for( int b = 0; b < constant_defs.length; b++ )
{
constants[b] = constant_defs[b].describe_constant();
}
if (operations == null)
{
throw new INTF_REPOS ("operations null!");
}
if (attributes == null)
{
throw new INTF_REPOS ("attributes null!");
}
fullDescription =
new FullInterfaceDescription( name,
id,