Package org.omg.CORBA

Examples of org.omg.CORBA.TCKind


    @Test
    public void testAccessStructMembers ()
   {
      String msg;
      String memberName = null;
      TCKind memberKind = null;
      org.omg.CORBA.TypeCode tc = null;
      org.omg.DynamicAny.DynStruct dynAny = null;

      tc = NonEmptyExceptionHelper.type ();
      dynAny = createDynAnyFromTypeCode (tc);

      // test getting the name of the current member
      msg = "Failed to get the correct name of the first member using ";
      msg += "DynStruct::current_member_name operation";
      try
      {
         memberName = dynAny.current_member_name ();

         assertEquals (msg, "field1", memberName); // specific to IDL
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
      catch (Throwable ex)
      {
         fail (msg + ": " + ex);
      }

      // test getting the kind of the current member
      msg = "Failed to get the correct kind of the first member using ";
      msg += "DynStruct::current_member_kind operation";
      try
      {
         memberKind = dynAny.current_member_kind ();

         // specific to IDL
         assertEquals (msg, TCKind._tk_long, memberKind.value ());
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
      catch (Throwable ex)
      {
         fail (msg + ": " + ex);
      }

      // move to the next position
      dynAny.next ();

      // test getting the name of the current member
      msg = "Failed to get the correct name of the second member using ";
      msg += "DynStruct::current_member_name operation";
      try
      {
         memberName = dynAny.current_member_name ();

         assertEquals (msg, "field2", memberName); // specific to IDL
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
      catch (Throwable ex)
      {
         fail (msg + ": " + ex);
      }

      // test getting the kind of the current member
      msg = "Failed to get the correct kind of the second member using ";
      msg += "DynStruct::current_member_kind operation";
      try
      {
         memberKind = dynAny.current_member_kind ();

         // specific to IDL
         assertEquals (msg, TCKind._tk_string, memberKind.value ());
      }
      catch (AssertionFailedError ex)
      {
         throw ex;
      }
View Full Code Here


            {
                writeIndirectionMarker(out, typeCode.id(), recursiveTCMap);
            }
            else
            {
                final TCKind kind = typeCode.kind();
                final TypeCodeWriter delegate = (TypeCodeWriter) writerMap.get(kind);

                if (delegate == null)
                {
                    throw new MARSHAL("Cannot handle TypeCode with kind: " + kind);
View Full Code Here

    /**
     * Return the LocalIDLType for the given TypeCode.
     */
    static LocalIDLType getIDLType(TypeCode typeCode, RepositoryImpl repository) {
        TCKind tcKind = typeCode.kind();

        if (PrimitiveDefImpl.isPrimitiveTCKind(tcKind))
            return new PrimitiveDefImpl(typeCode, repository);

        if (tcKind == TCKind.tk_sequence)
            return repository.getSequenceImpl(typeCode);

        if (tcKind == TCKind.tk_value || tcKind == TCKind.tk_value_box ||
                tcKind == TCKind.tk_alias || tcKind == TCKind.tk_struct ||
                tcKind == TCKind.tk_union || tcKind == TCKind.tk_enum ||
                tcKind == TCKind.tk_objref) {
            try {
                return (LocalIDLType) repository._lookup_id(typeCode.id());
            } catch (BadKind ex) {
                throw new RuntimeException("Bad kind for TypeCode.id()");
            }
        }

        throw new RuntimeException("TODO: tcKind=" + tcKind.value());
    }
View Full Code Here

        }
        return tc;
    }

    public static TypeCode getPrimitiveTypeCode(ORB orb, QName type) {
        TCKind kind = PRIMITIVE_TYPECODES.get(type);
        if (kind != null) {
            return orb.get_primitive_tc(kind);
        }

        // There is a possiblitity that the idl type will not have its namespace URI set if it has
View Full Code Here

        }
        return name;
    }

    public static boolean isPrimitiveIdlType(QName idltype) {
        TCKind kind = PRIMITIVE_TYPECODES.get(idltype);
        if (kind != null) {
            return true;
        }

        // There is a possiblitity that the idl type will not have its namespace URI set if it has
View Full Code Here

        }
        return tc;
    }

    public static TypeCode getPrimitiveTypeCode(ORB orb, QName type) {
        TCKind kind = PRIMITIVE_TYPECODES.get(type);
        if (kind != null) {
            return orb.get_primitive_tc(kind);
        }

        // There is a possiblitity that the idl type will not have its namespace URI set if it has
View Full Code Here

        }
        return name;
    }

    public static boolean isPrimitiveIdlType(QName idltype) {
        TCKind kind = PRIMITIVE_TYPECODES.get(idltype);
        if (kind != null) {
            return true;
        }

        // There is a possiblitity that the idl type will not have its namespace URI set if it has
View Full Code Here

    public static QName convertPrimitiveIdlToSchemaType(QName idlType) {
        return IDL_TO_SCHEMA_TYPES.get(idlType);
    }

    public static QName getPrimitiveIdlTypeFromTypeCode(TypeCode tc) {
        TCKind type = tc.kind();
        QName result = null;

        switch(type.value()) {
        case TCKind._tk_boolean:
            result = CorbaConstants.NT_CORBA_BOOLEAN;
            break;
        case TCKind._tk_char:
            result = CorbaConstants.NT_CORBA_CHAR;
View Full Code Here

TOP

Related Classes of org.omg.CORBA.TCKind

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.