org.omegahat.Interfaces.CORBA
Class CorbaConverter

java.lang.Object
  |
  +--org.omegahat.Interfaces.CORBA.CorbaConverter
All Implemented Interfaces:
CorbaConverterInt
Direct Known Subclasses:
DynamicObjectCorbaConverter

public class CorbaConverter
extends java.lang.Object
implements CorbaConverterInt


Field Summary
protected  boolean debug
           
protected  org.omg.CORBA.ORB orb
           
 
Constructor Summary
CorbaConverter()
           
 
Method Summary
 java.lang.Object[] argumentsToObjects(org.omg.CORBA.NVList params)
          Converts a collection of arguments passed to via the invoke() method of a dynamic java server object to regular Java objects.
 java.lang.Object argumentToObject(org.omg.CORBA.NamedValue param)
          Converts an individual argument in a Named Value list to a Java object.
 boolean arrayInsert(org.omg.CORBA.Any any, org.omg.CORBA.TypeCode type, java.lang.Object array, int index)
           
 java.lang.Object as(java.lang.Object o, java.lang.String type)
          Convert an object to a named type, specifically used for String and Character.
 java.lang.Object asArray(java.lang.Object[] els, int n)
          Convert a generic array of objects into a more specific array with the appropriate component type class and dimensions.
 boolean asBoolean(java.lang.Object o)
          Treate the object as a logical value in some appropriate manner depending on the class of the object.
 boolean[] asBooleanArray(java.lang.Object array)
           
 char[] asCharArray(java.lang.Object array)
           
 double[] asDoubleArray(java.lang.Object array)
          Treat the specified object as a Java array and convert it to a Double array.
 float[] asFloatArray(java.lang.Object array)
           
 int[] asLongArray(java.lang.Object array)
           
 double asNumber(java.lang.Object o)
          Treat the specified object as a number in some meaningul way appropriate for the class of the object.
 short[] asShortArray(java.lang.Object array)
           
 java.lang.Class convertToPrimitiveClass(java.lang.Class c)
           
 boolean debug()
           
 boolean debug(boolean val)
           
 java.lang.Object fromCORBA(org.omg.CORBA.Any val)
           
protected  java.lang.Object fromCORBA(org.omg.CORBA.Any val, org.omg.CORBA.TypeCode type)
           
 org.omg.CORBA.Any fromJavaObject(org.omg.CORBA.Any any, java.lang.Object o)
           
 java.lang.Class getArrayInfo(java.lang.Object object, java.util.Vector dims)
           
 java.lang.Class getArrayInfo(java.lang.Object object, java.util.Vector dims, int start)
           
 java.lang.Class getCommonClass(java.lang.Class a, java.lang.Class b)
           
 org.omg.CORBA.ORB orb()
           
 org.omg.CORBA.ORB orb(org.omg.CORBA.ORB o)
           
 org.omg.CORBA.Any toCORBA(org.omg.CORBA.Any any, java.lang.Object o)
           
 org.omg.CORBA.Any toCORBA(org.omg.CORBA.Any any, java.lang.Object o, org.omg.CORBA.TypeCode type)
           
 org.omg.CORBA.Any toCORBA(java.lang.Object o, org.omg.CORBA.TypeCode type)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

protected boolean debug

orb

protected org.omg.CORBA.ORB orb
Constructor Detail

CorbaConverter

public CorbaConverter()
Method Detail

asNumber

public double asNumber(java.lang.Object o)
Treat the specified object as a number in some meaningul way appropriate for the class of the object.

asBoolean

public boolean asBoolean(java.lang.Object o)
Treate the object as a logical value in some appropriate manner depending on the class of the object.

as

public java.lang.Object as(java.lang.Object o,
                           java.lang.String type)
Convert an object to a named type, specifically used for String and Character.

arrayInsert

public boolean arrayInsert(org.omg.CORBA.Any any,
                           org.omg.CORBA.TypeCode type,
                           java.lang.Object array,
                           int index)
                    throws java.lang.Exception

asDoubleArray

public double[] asDoubleArray(java.lang.Object array)
Treat the specified object as a Java array and convert it to a Double array.

asFloatArray

public float[] asFloatArray(java.lang.Object array)

asShortArray

public short[] asShortArray(java.lang.Object array)

asLongArray

public int[] asLongArray(java.lang.Object array)

asBooleanArray

public boolean[] asBooleanArray(java.lang.Object array)

asCharArray

public char[] asCharArray(java.lang.Object array)

argumentsToObjects

public java.lang.Object[] argumentsToObjects(org.omg.CORBA.NVList params)
Converts a collection of arguments passed to via the invoke() method of a dynamic java server object to regular Java objects.
Specified by:
argumentsToObjects in interface CorbaConverterInt

argumentToObject

public java.lang.Object argumentToObject(org.omg.CORBA.NamedValue param)
Converts an individual argument in a Named Value list to a Java object.

fromCORBA

public java.lang.Object fromCORBA(org.omg.CORBA.Any val)
Specified by:
fromCORBA in interface CorbaConverterInt

fromCORBA

protected java.lang.Object fromCORBA(org.omg.CORBA.Any val,
                                     org.omg.CORBA.TypeCode type)

toCORBA

public org.omg.CORBA.Any toCORBA(org.omg.CORBA.Any any,
                                 java.lang.Object o)
                          throws java.lang.Exception
Specified by:
toCORBA in interface CorbaConverterInt

toCORBA

public org.omg.CORBA.Any toCORBA(java.lang.Object o,
                                 org.omg.CORBA.TypeCode type)
                          throws java.lang.Exception
Specified by:
toCORBA in interface CorbaConverterInt

toCORBA

public org.omg.CORBA.Any toCORBA(org.omg.CORBA.Any any,
                                 java.lang.Object o,
                                 org.omg.CORBA.TypeCode type)
                          throws java.lang.Exception

fromJavaObject

public org.omg.CORBA.Any fromJavaObject(org.omg.CORBA.Any any,
                                        java.lang.Object o)
                                 throws java.lang.Exception

debug

public boolean debug()

debug

public boolean debug(boolean val)

orb

public org.omg.CORBA.ORB orb()

orb

public org.omg.CORBA.ORB orb(org.omg.CORBA.ORB o)

asArray

public java.lang.Object asArray(java.lang.Object[] els,
                                int n)
Convert a generic array of objects into a more specific array with the appropriate component type class and dimensions. This works recursively to determine the dimensions and the common component class.

getArrayInfo

public java.lang.Class getArrayInfo(java.lang.Object object,
                                    java.util.Vector dims)

getArrayInfo

public java.lang.Class getArrayInfo(java.lang.Object object,
                                    java.util.Vector dims,
                                    int start)

getCommonClass

public java.lang.Class getCommonClass(java.lang.Class a,
                                      java.lang.Class b)

convertToPrimitiveClass

public java.lang.Class convertToPrimitiveClass(java.lang.Class c)