Horus Doc || Java GUI Reference || Doxygen's quick Index  

ChoiceFactory Class Reference

A factory for CorbaObjectChoice's. More...

List of all members.

Static Public Methods

CorbaObjectChoice getChoice (TypeCode tc)
InterfaceChoice getInterfaceChoice (String id, String name)


Detailed Description

A factory for CorbaObjectChoice's.


Member Function Documentation

CorbaObjectChoice ChoiceFactory::getChoice TypeCode    tc [inline, static]
 

00023 {
00024     //Try a specialized choicer
00025     try {
00026         //System.out.println("trying HxJava.CorbaLink.ObjectChoice."+tc.name()+"Choice");
00027         Class c = Class.forName("HxJava.CorbaLink.ObjectChoice."+tc.name()+"Choice");
00028         Class[] argsC = { TypeCode.class };
00029         java.lang.Object[] argsO = { tc };
00030         Constructor cons = c.getConstructor(argsC);
00031         java.lang.Object choice = cons.newInstance(argsO);
00032         //System.out.println(choice.getClass().getName());
00033         return (CorbaObjectChoice)choice;
00034     }catch(Exception e) {
00035         //System.out.println(e);
00036     }
00037 
00038     if(tc.kind()==TCKind.tk_void)           return new VoidChoice(tc);
00039     else if(tc.kind()==TCKind.tk_long)      return new LongChoice(tc);
00040     else if(tc.kind()==TCKind.tk_double)    return new DoubleChoice(tc);
00041     else if(tc.kind()==TCKind.tk_boolean)   return new BooleanChoice(tc);
00042     else if(tc.kind()==TCKind.tk_octet)     return new OctetChoice(tc);
00043     else if(tc.kind()==TCKind.tk_string)    return new StringChoice(tc);
00044 
00045     else if(tc.kind()==TCKind.tk_alias)     return new AliasChoice(tc);
00046 
00047     else if(tc.kind()==TCKind.tk_objref)    return new InterfaceChoice(tc);
00048     else if(tc.kind()==TCKind.tk_struct)    return new StructChoice(tc);
00049     else if(tc.kind()==TCKind.tk_sequence)  return new SequenceChoice(tc);
00050     else if(tc.kind()==TCKind.tk_enum)      return new EnumChoice(tc);
00051 
00052     OutputStreamArea.println("Type "+tc.kind().value()+" not supported");
00053     return null;
00054 }

InterfaceChoice ChoiceFactory::getInterfaceChoice String    id,
String    name
[inline, static]
 

00057 {
00058     org.omg.CORBA.ORB orb = org.omg.CORBA.ORB.init();
00059     return new InterfaceChoice(orb.create_interface_tc(id, name));
00060 }


The documentation for this class was generated from the following file:
Generated on Mon Jan 27 15:11:17 2003 for JavaReference by doxygen1.2.12 written by Dimitri van Heesch, © 1997-2001