Java Code Examples for org.omg.CORBA.TCKind#_tk_sequence

The following examples show how to use org.omg.CORBA.TCKind#_tk_sequence . These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may want to check out the right sidebar which shows the related API usage.
Example 1
private TypeCodeImpl lazy_content_type() {
    if (_contentType == null) {
        if (_kind == TCKind._tk_sequence && _parentOffset > 0 && _parent != null) {
            // This is an unresolved recursive sequence tc.
            // Try to resolve it now if the hierarchy is complete.
            TypeCodeImpl realParent = getParentAtLevel(_parentOffset);
            if (realParent != null && realParent._id != null) {
                // Create a recursive type code object as the content type.
                // This is when the recursive sequence typecode morphes
                // into a sequence typecode containing a recursive typecode.
                _contentType = new TypeCodeImpl((ORB)_orb, realParent._id);
            }
        }
    }
    return _contentType;
}
 
Example 2
public TypeCode content_type()
    throws BadKind
{
    switch (_kind) {
    case tk_indirect:
        return indirectType().content_type();
    case TCKind._tk_sequence:
        return lazy_content_type();
    case TCKind._tk_array:
    case TCKind._tk_alias:
    case TCKind._tk_value_box:
        return _contentType;
    default:
        throw new BadKind();
    }
}
 
Example 3
private TypeCodeImpl lazy_content_type() {
    if (_contentType == null) {
        if (_kind == TCKind._tk_sequence && _parentOffset > 0 && _parent != null) {
            // This is an unresolved recursive sequence tc.
            // Try to resolve it now if the hierarchy is complete.
            TypeCodeImpl realParent = getParentAtLevel(_parentOffset);
            if (realParent != null && realParent._id != null) {
                // Create a recursive type code object as the content type.
                // This is when the recursive sequence typecode morphes
                // into a sequence typecode containing a recursive typecode.
                _contentType = new TypeCodeImpl((ORB)_orb, realParent._id);
            }
        }
    }
    return _contentType;
}
 
Example 4
Source Project: JDKSourceCode1.8   File: TypeCodeImpl.java    License: MIT License 6 votes vote down vote up
private TypeCodeImpl lazy_content_type() {
    if (_contentType == null) {
        if (_kind == TCKind._tk_sequence && _parentOffset > 0 && _parent != null) {
            // This is an unresolved recursive sequence tc.
            // Try to resolve it now if the hierarchy is complete.
            TypeCodeImpl realParent = getParentAtLevel(_parentOffset);
            if (realParent != null && realParent._id != null) {
                // Create a recursive type code object as the content type.
                // This is when the recursive sequence typecode morphes
                // into a sequence typecode containing a recursive typecode.
                _contentType = new TypeCodeImpl((ORB)_orb, realParent._id);
            }
        }
    }
    return _contentType;
}
 
Example 5
public TypeCode content_type()
    throws BadKind
{
    switch (_kind) {
    case tk_indirect:
        return indirectType().content_type();
    case TCKind._tk_sequence:
        return lazy_content_type();
    case TCKind._tk_array:
    case TCKind._tk_alias:
    case TCKind._tk_value_box:
        return _contentType;
    default:
        throw new BadKind();
    }
}
 
Example 6
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    int bound,
                    TypeCode element_type)
                    // for sequences and arrays
{
    this(orb) ;

    if ( creationKind == TCKind._tk_sequence || creationKind == TCKind._tk_array ) {
        _kind               = creationKind;
        _length             = bound;
        _contentType        = convertToNative(_orb, element_type);
    } // else initializes to null
}
 
Example 7
Source Project: JDKSourceCode1.8   File: TypeCodeImpl.java    License: MIT License 5 votes vote down vote up
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    int bound,
                    int offset)
                    // for recursive sequences
{
    this(orb) ;

    if (creationKind == TCKind._tk_sequence) {
        _kind               = creationKind;
        _length             = bound;
        _parentOffset       = offset;
    } // else initializes to null
}
 
Example 8
public int length()
    throws BadKind
{
    switch (_kind) {
    case tk_indirect:
        return indirectType().length();
    case TCKind._tk_string:
    case TCKind._tk_wstring:
    case TCKind._tk_sequence:
    case TCKind._tk_array:
        return _length;
    default:
        throw new BadKind();
    }
}
 
Example 9
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    int bound,
                    TypeCode element_type)
                    // for sequences and arrays
{
    this(orb) ;

    if ( creationKind == TCKind._tk_sequence || creationKind == TCKind._tk_array ) {
        _kind               = creationKind;
        _length             = bound;
        _contentType        = convertToNative(_orb, element_type);
    } // else initializes to null
}
 
Example 10
static DynAny createMostDerivedDynAny(TypeCode typeCode, ORB orb)
    throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode
{
    if (typeCode == null || ! DynAnyUtil.isConsistentType(typeCode))
        throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();

    switch (typeCode.kind().value()) {
        case TCKind._tk_sequence:
            return new DynSequenceImpl(orb, typeCode);
        case TCKind._tk_struct:
            return new DynStructImpl(orb, typeCode);
        case TCKind._tk_array:
            return new DynArrayImpl(orb, typeCode);
        case TCKind._tk_union:
            return new DynUnionImpl(orb, typeCode);
        case TCKind._tk_enum:
            return new DynEnumImpl(orb, typeCode);
        case TCKind._tk_fixed:
            return new DynFixedImpl(orb, typeCode);
        case TCKind._tk_value:
            return new DynValueImpl(orb, typeCode);
        case TCKind._tk_value_box:
            return new DynValueBoxImpl(orb, typeCode);
        default:
            return new DynAnyBasicImpl(orb, typeCode);
    }
}
 
Example 11
Source Project: cxf   File: CorbaHandlerUtils.java    License: Apache License 2.0 5 votes vote down vote up
public static CorbaObjectHandler initializeObjectHandler(ORB orb,
                                                         QName name,
                                                         QName idlType,
                                                         CorbaTypeMap typeMap,
                                                         ServiceInfo serviceInfo,
                                                         Map<QName, CorbaObjectHandler> seenTypes) {
    CorbaObjectHandler obj = createTypeHandler(orb, name, idlType, typeMap);
    if (!CorbaUtils.isPrimitiveIdlType(idlType)) {
        switch (obj.getTypeCode().kind().value()) {
        case TCKind._tk_any:
            ((CorbaAnyHandler)obj).setValue(orb.create_any());
            break;
        case TCKind._tk_array:
            initializeArrayHandler(orb, obj, typeMap, serviceInfo, seenTypes);
            break;
        case TCKind._tk_except:
            initializeExceptionHandler(orb, obj, typeMap, serviceInfo, seenTypes);
            break;
        case TCKind._tk_sequence:
            if (!isOctets(obj.getType())) {
                initializeSequenceHandler(orb, obj, typeMap, serviceInfo, seenTypes);
            }
            break;
        case TCKind._tk_struct:
            initializeStructHandler(orb, obj, typeMap, serviceInfo, seenTypes);
            break;
        case TCKind._tk_union:
            initializeUnionHandler(orb, obj, typeMap, serviceInfo, seenTypes);
            break;

        default:
            //nothing to do, the Read/Write routines will throw exceptions
        }
    }
    return obj;
}
 
Example 12
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    int bound,
                    int offset)
                    // for recursive sequences
{
    this(orb) ;

    if (creationKind == TCKind._tk_sequence) {
        _kind               = creationKind;
        _length             = bound;
        _parentOffset       = offset;
    } // else initializes to null
}
 
Example 13
Source Project: jdk8u60   File: DynAnyUtil.java    License: GNU General Public License v2.0 5 votes vote down vote up
static DynAny createMostDerivedDynAny(TypeCode typeCode, ORB orb)
    throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode
{
    if (typeCode == null || ! DynAnyUtil.isConsistentType(typeCode))
        throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();

    switch (typeCode.kind().value()) {
        case TCKind._tk_sequence:
            return new DynSequenceImpl(orb, typeCode);
        case TCKind._tk_struct:
            return new DynStructImpl(orb, typeCode);
        case TCKind._tk_array:
            return new DynArrayImpl(orb, typeCode);
        case TCKind._tk_union:
            return new DynUnionImpl(orb, typeCode);
        case TCKind._tk_enum:
            return new DynEnumImpl(orb, typeCode);
        case TCKind._tk_fixed:
            return new DynFixedImpl(orb, typeCode);
        case TCKind._tk_value:
            return new DynValueImpl(orb, typeCode);
        case TCKind._tk_value_box:
            return new DynValueBoxImpl(orb, typeCode);
        default:
            return new DynAnyBasicImpl(orb, typeCode);
    }
}
 
Example 14
public TypeCodeImpl(ORB orb,
                    int creationKind,
                    int bound,
                    TypeCode element_type)
                    // for sequences and arrays
{
    this(orb) ;

    if ( creationKind == TCKind._tk_sequence || creationKind == TCKind._tk_array ) {
        _kind               = creationKind;
        _length             = bound;
        _contentType        = convertToNative(_orb, element_type);
    } // else initializes to null
}
 
Example 15
Source Project: JDKSourceCode1.8   File: DynAnyUtil.java    License: MIT License 5 votes vote down vote up
static DynAny createMostDerivedDynAny(TypeCode typeCode, ORB orb)
    throws org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode
{
    if (typeCode == null || ! DynAnyUtil.isConsistentType(typeCode))
        throw new org.omg.DynamicAny.DynAnyFactoryPackage.InconsistentTypeCode();

    switch (typeCode.kind().value()) {
        case TCKind._tk_sequence:
            return new DynSequenceImpl(orb, typeCode);
        case TCKind._tk_struct:
            return new DynStructImpl(orb, typeCode);
        case TCKind._tk_array:
            return new DynArrayImpl(orb, typeCode);
        case TCKind._tk_union:
            return new DynUnionImpl(orb, typeCode);
        case TCKind._tk_enum:
            return new DynEnumImpl(orb, typeCode);
        case TCKind._tk_fixed:
            return new DynFixedImpl(orb, typeCode);
        case TCKind._tk_value:
            return new DynValueImpl(orb, typeCode);
        case TCKind._tk_value_box:
            return new DynValueBoxImpl(orb, typeCode);
        default:
            return new DynAnyBasicImpl(orb, typeCode);
    }
}
 
Example 16
public TypeCode create_sequence_tc(int bound,
                                   TypeCode element_type)
{
    return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type);
}
 
Example 17
private void printStream(PrintStream s, int level) {
    if (_kind == tk_indirect) {
        s.print("indirect " + _id);
        return;
    }

    switch (_kind) {
        case TCKind._tk_null:
        case TCKind._tk_void:
        case TCKind._tk_short:
        case TCKind._tk_long:
        case TCKind._tk_ushort:
        case TCKind._tk_ulong:
        case TCKind._tk_float:
        case TCKind._tk_double:
        case TCKind._tk_boolean:
        case TCKind._tk_char:
        case TCKind._tk_octet:
        case TCKind._tk_any:
        case TCKind._tk_TypeCode:
        case TCKind._tk_Principal:
        case TCKind._tk_objref:
        case TCKind._tk_longlong:
        case TCKind._tk_ulonglong:
        case TCKind._tk_longdouble:
        case TCKind._tk_wchar:
        case TCKind._tk_native:
            s.print(kindNames[_kind] + " " + _name);
            break;

        case TCKind._tk_struct:
        case TCKind._tk_except:
        case TCKind._tk_value:
            s.println(kindNames[_kind] + " " + _name + " = {");
            for(int i=0; i<_memberCount; i++) {
                // memberName might differ from the name of the member.
                s.print(indent(level + 1));
                if (_memberTypes[i] != null)
                    _memberTypes[i].printStream(s, level + 1);
                else
                    s.print("<unknown type>");
                s.println(" " + _memberNames[i] + ";");
            }
            s.print(indent(level) + "}");
            break;

        case TCKind._tk_union:
            s.print("union " + _name + "...");
            break;

        case TCKind._tk_enum:
            s.print("enum " + _name + "...");
            break;

        case TCKind._tk_string:
            if (_length == 0)
                s.print("unbounded string " + _name);
            else
                s.print("bounded string(" + _length + ") " + _name);
            break;

        case TCKind._tk_sequence:
        case TCKind._tk_array:
            s.println(kindNames[_kind] + "[" + _length + "] " + _name + " = {");
            s.print(indent(level + 1));
            if (lazy_content_type() != null) {
                lazy_content_type().printStream(s, level + 1);
            }
            s.println(indent(level) + "}");
            break;

        case TCKind._tk_alias:
            s.print("alias " + _name + " = " +
                (_contentType != null ? _contentType._name : "<unresolved>"));
            break;

        case TCKind._tk_wstring:
            s.print("wstring[" + _length + "] " + _name);
            break;

        case TCKind._tk_fixed:
            s.print("fixed(" + _digits + ", " + _scale + ") " + _name);
            break;

        case TCKind._tk_value_box:
            s.print("valueBox " + _name + "...");
            break;

        case TCKind._tk_abstract_interface:
            s.print("abstractInterface " + _name + "...");
            break;

        default:
            s.print("<unknown type>");
            break;
    }
}
 
Example 18
public TypeCode create_sequence_tc(int bound,
                                   TypeCode element_type)
{
    return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type);
}
 
Example 19
/**
 * Create a TypeCode for a sequence.
 *
 * @param bound     the bound for the sequence.
 * @param element_type
 *                  the type of elements of the sequence.
 * @return          the requested TypeCode.
 */
public synchronized TypeCode create_sequence_tc(int bound,
                                   TypeCode element_type)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_sequence, bound, element_type);
}
 
Example 20
Source Project: jdk8u60   File: ORBImpl.java    License: GNU General Public License v2.0 3 votes vote down vote up
/**
 * Create a recursive TypeCode in a sequence.
 *
 * @param bound     the bound for the sequence.
 * @param offset    the index to the enclosing TypeCode that is
 *                  being referenced.
 * @return          the requested TypeCode.
 */
public synchronized TypeCode create_recursive_sequence_tc(int bound,
                                             int offset)
{
    checkShutdownState();
    return new TypeCodeImpl(this, TCKind._tk_sequence, bound, offset);
}