Package com.sun.corba.se.impl.encoding

Examples of com.sun.corba.se.impl.encoding.TypeCodeInputStream


            }
            break;

        case COMPLEX:
            {
                TypeCodeInputStream _encap = TypeCodeInputStream.readEncapsulation(is,
                    is.orb());

                switch(_kind) {

                case TCKind._tk_objref:
                case TCKind._tk_abstract_interface:
                    {
                        // get the repository id
                        setId(_encap.read_string());
                        // get the name
                        _name = _encap.read_string();
                    }
                    break;

                case TCKind._tk_union:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // discriminant typecode
                        _discriminator = new TypeCodeImpl((ORB)is.orb());
                        _discriminator.read_value_recursive(_encap);

                        // default index
                        _defaultIndex = _encap.read_long();

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the label values, names and types of members
                        _unionLabels = new AnyImpl[_memberCount];
                        _memberNames = new String[_memberCount];
                        _memberTypes = new TypeCodeImpl[_memberCount];

                        // read off label values, names and types
                        for (int i=0; i < _memberCount; i++) {
                            _unionLabels[i] = new AnyImpl((ORB)is.orb());
                            if (i == _defaultIndex)
                                // for the default case, read off the zero octet
                                _unionLabels[i].insert_octet(_encap.read_octet());
                            else {
                                switch (realType(_discriminator).kind().value()) {
                                case TCKind._tk_short:
                                    _unionLabels[i].insert_short(_encap.read_short());
                                    break;
                                case TCKind._tk_long:
                                    _unionLabels[i].insert_long(_encap.read_long());
                                    break;
                                case TCKind._tk_ushort:
                                    _unionLabels[i].insert_ushort(_encap.read_short());
                                    break;
                                case TCKind._tk_ulong:
                                    _unionLabels[i].insert_ulong(_encap.read_long());
                                    break;
                                case TCKind._tk_float:
                                    _unionLabels[i].insert_float(_encap.read_float());
                                    break;
                                case TCKind._tk_double:
                                    _unionLabels[i].insert_double(_encap.read_double());
                                    break;
                                case TCKind._tk_boolean:
                                    _unionLabels[i].insert_boolean(_encap.read_boolean());
                                    break;
                                case TCKind._tk_char:
                                    _unionLabels[i].insert_char(_encap.read_char());
                                    break;
                                case TCKind._tk_enum:
                                    _unionLabels[i].type(_discriminator);
                                    _unionLabels[i].insert_long(_encap.read_long());
                                    break;
                                case TCKind._tk_longlong:
                                    _unionLabels[i].insert_longlong(_encap.read_longlong());
                                    break;
                                case TCKind._tk_ulonglong:
                                    _unionLabels[i].insert_ulonglong(_encap.read_longlong());
                                    break;
                                    // _REVISIT_ figure out long double mapping
                                    // case TCKind.tk_longdouble:
                                    // _unionLabels[i].insert_longdouble(_encap.getDouble());
                                    // break;
                                case TCKind._tk_wchar:
                                    _unionLabels[i].insert_wchar(_encap.read_wchar());
                                    break;
                                default:
                                    throw wrapper.invalidComplexTypecode() ;
                                }
                            }
                            _memberNames[i] = _encap.read_string();
                            _memberTypes[i] = new TypeCodeImpl((ORB)is.orb());
                            _memberTypes[i].read_value_recursive(_encap);
                            _memberTypes[i].setParent(this);
                        }
                    }
                    break;

                case TCKind._tk_enum:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the identifier names
                        _memberNames = new String[_memberCount];

                        // read off identifier names
                        for (int i=0; i < _memberCount; i++)
                            _memberNames[i] = _encap.read_string();
                    }
                    break;

                case TCKind._tk_sequence:
                    {
                        // get the type of the sequence
                        _contentType = new TypeCodeImpl((ORB)is.orb());
                        _contentType.read_value_recursive(_encap);

                        // get the bound on the length of the sequence
                        _length = _encap.read_long();
                    }
                    break;

                case TCKind._tk_array:
                    {
                        // get the type of the array
                        _contentType = new TypeCodeImpl((ORB)is.orb());
                        _contentType.read_value_recursive(_encap);

                        // get the length of the array
                        _length = _encap.read_long();
                    }
                    break;

                case TCKind._tk_alias:
                case TCKind._tk_value_box:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the type aliased
                        _contentType = new TypeCodeImpl((ORB)is.orb());
                        _contentType.read_value_recursive(_encap);
                    }
                    break;

                case TCKind._tk_except:
                case TCKind._tk_struct:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the names and types of members
                        _memberNames = new String[_memberCount];
                        _memberTypes = new TypeCodeImpl[_memberCount];

                        // read off member names and types
                        for (int i=0; i < _memberCount; i++) {
                            _memberNames[i] = _encap.read_string();
                            _memberTypes[i] = new TypeCodeImpl((ORB)is.orb());
                            //if (debug) System.out.println("TypeCode " + _name +
                            // " reading member " + _memberNames[i]);
                            _memberTypes[i].read_value_recursive(_encap);
                            _memberTypes[i].setParent(this);
                        }
                    }
                    break;

                case TCKind._tk_value:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the type modifier
                        _type_modifier = _encap.read_short();

                        // get the type aliased
                        _concrete_base = new TypeCodeImpl((ORB)is.orb());
                        _concrete_base.read_value_recursive(_encap);
                        if (_concrete_base.kind().value() == TCKind._tk_null) {
                            _concrete_base = null;
                        }

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the names, types and visibility of members
                        _memberNames = new String[_memberCount];
                        _memberTypes = new TypeCodeImpl[_memberCount];
                        _memberAccess = new short[_memberCount];

                        // read off value member visibilities
                        for (int i=0; i < _memberCount; i++) {
                            _memberNames[i] = _encap.read_string();
                            _memberTypes[i] = new TypeCodeImpl((ORB)is.orb());
                            //if (debug) System.out.println("TypeCode " + _name +
                            // " reading member " + _memberNames[i]);
                            _memberTypes[i].read_value_recursive(_encap);
                            _memberTypes[i].setParent(this);
                            _memberAccess[i] = _encap.read_short();
                        }
                    }
                    break;

                default:
View Full Code Here


            }
            break;

        case COMPLEX:
            {
                TypeCodeInputStream _encap = TypeCodeInputStream.readEncapsulation(is,
                    is.orb());

                switch(_kind) {

                case TCKind._tk_objref:
                case TCKind._tk_abstract_interface:
                    {
                        // get the repository id
                        setId(_encap.read_string());
                        // get the name
                        _name = _encap.read_string();
                    }
                    break;

                case TCKind._tk_union:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // discriminant typecode
                        _discriminator = new TypeCodeImpl((ORB)is.orb());
                        _discriminator.read_value_recursive(_encap);

                        // default index
                        _defaultIndex = _encap.read_long();

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the label values, names and types of members
                        _unionLabels = new AnyImpl[_memberCount];
                        _memberNames = new String[_memberCount];
                        _memberTypes = new TypeCodeImpl[_memberCount];

                        // read off label values, names and types
                        for (int i=0; i < _memberCount; i++) {
                            _unionLabels[i] = new AnyImpl((ORB)is.orb());
                            if (i == _defaultIndex)
                                // for the default case, read off the zero octet
                                _unionLabels[i].insert_octet(_encap.read_octet());
                            else {
                                switch (realType(_discriminator).kind().value()) {
                                case TCKind._tk_short:
                                    _unionLabels[i].insert_short(_encap.read_short());
                                    break;
                                case TCKind._tk_long:
                                    _unionLabels[i].insert_long(_encap.read_long());
                                    break;
                                case TCKind._tk_ushort:
                                    _unionLabels[i].insert_ushort(_encap.read_short());
                                    break;
                                case TCKind._tk_ulong:
                                    _unionLabels[i].insert_ulong(_encap.read_long());
                                    break;
                                case TCKind._tk_float:
                                    _unionLabels[i].insert_float(_encap.read_float());
                                    break;
                                case TCKind._tk_double:
                                    _unionLabels[i].insert_double(_encap.read_double());
                                    break;
                                case TCKind._tk_boolean:
                                    _unionLabels[i].insert_boolean(_encap.read_boolean());
                                    break;
                                case TCKind._tk_char:
                                    _unionLabels[i].insert_char(_encap.read_char());
                                    break;
                                case TCKind._tk_enum:
                                    _unionLabels[i].type(_discriminator);
                                    _unionLabels[i].insert_long(_encap.read_long());
                                    break;
                                case TCKind._tk_longlong:
                                    _unionLabels[i].insert_longlong(_encap.read_longlong());
                                    break;
                                case TCKind._tk_ulonglong:
                                    _unionLabels[i].insert_ulonglong(_encap.read_longlong());
                                    break;
                                    // _REVISIT_ figure out long double mapping
                                    // case TCKind.tk_longdouble:
                                    // _unionLabels[i].insert_longdouble(_encap.getDouble());
                                    // break;
                                case TCKind._tk_wchar:
                                    _unionLabels[i].insert_wchar(_encap.read_wchar());
                                    break;
                                default:
                                    throw wrapper.invalidComplexTypecode() ;
                                }
                            }
                            _memberNames[i] = _encap.read_string();
                            _memberTypes[i] = new TypeCodeImpl((ORB)is.orb());
                            _memberTypes[i].read_value_recursive(_encap);
                            _memberTypes[i].setParent(this);
                        }
                    }
                    break;

                case TCKind._tk_enum:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the identifier names
                        _memberNames = new String[_memberCount];

                        // read off identifier names
                        for (int i=0; i < _memberCount; i++)
                            _memberNames[i] = _encap.read_string();
                    }
                    break;

                case TCKind._tk_sequence:
                    {
                        // get the type of the sequence
                        _contentType = new TypeCodeImpl((ORB)is.orb());
                        _contentType.read_value_recursive(_encap);

                        // get the bound on the length of the sequence
                        _length = _encap.read_long();
                    }
                    break;

                case TCKind._tk_array:
                    {
                        // get the type of the array
                        _contentType = new TypeCodeImpl((ORB)is.orb());
                        _contentType.read_value_recursive(_encap);

                        // get the length of the array
                        _length = _encap.read_long();
                    }
                    break;

                case TCKind._tk_alias:
                case TCKind._tk_value_box:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the type aliased
                        _contentType = new TypeCodeImpl((ORB)is.orb());
                        _contentType.read_value_recursive(_encap);
                    }
                    break;

                case TCKind._tk_except:
                case TCKind._tk_struct:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the names and types of members
                        _memberNames = new String[_memberCount];
                        _memberTypes = new TypeCodeImpl[_memberCount];

                        // read off member names and types
                        for (int i=0; i < _memberCount; i++) {
                            _memberNames[i] = _encap.read_string();
                            _memberTypes[i] = new TypeCodeImpl((ORB)is.orb());
                            //if (debug) System.out.println("TypeCode " + _name +
                            // " reading member " + _memberNames[i]);
                            _memberTypes[i].read_value_recursive(_encap);
                            _memberTypes[i].setParent(this);
                        }
                    }
                    break;

                case TCKind._tk_value:
                    {
                        // get the repository id
                        setId(_encap.read_string());

                        // get the name
                        _name = _encap.read_string();

                        // get the type modifier
                        _type_modifier = _encap.read_short();

                        // get the type aliased
                        _concrete_base = new TypeCodeImpl((ORB)is.orb());
                        _concrete_base.read_value_recursive(_encap);
                        if (_concrete_base.kind().value() == TCKind._tk_null) {
                            _concrete_base = null;
                        }

                        // get the number of members
                        _memberCount = _encap.read_long();

                        // create arrays for the names, types and visibility of members
                        _memberNames = new String[_memberCount];
                        _memberTypes = new TypeCodeImpl[_memberCount];
                        _memberAccess = new short[_memberCount];

                        // read off value member visibilities
                        for (int i=0; i < _memberCount; i++) {
                            _memberNames[i] = _encap.read_string();
                            _memberTypes[i] = new TypeCodeImpl((ORB)is.orb());
                            //if (debug) System.out.println("TypeCode " + _name +
                            // " reading member " + _memberNames[i]);
                            _memberTypes[i].read_value_recursive(_encap);
                            _memberTypes[i].setParent(this);
                            _memberAccess[i] = _encap.read_short();
                        }
                    }
                    break;

                default:
View Full Code Here

TOP

Related Classes of com.sun.corba.se.impl.encoding.TypeCodeInputStream

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.