Package org.apache.schemas.yoko.bindings.corba

Examples of org.apache.schemas.yoko.bindings.corba.Sequence


       
        // create an sequence of strings
        QName stringIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "string", CorbaConstants.NP_WSDL_CORBA);
        QName seqIdlType = new QName(CorbaConstants.NU_WSDL_CORBA, "sequence", CorbaConstants.NP_WSDL_CORBA);

        Sequence seqType = new Sequence();
        seqType.setBound(data.length);
        seqType.setElemtype(stringIdlType);       
        // name and respoitory ID of the sequence are not needed for this test

        // build the object holder for a sequence.
        TypeCode seqTC = orb.create_sequence_tc(data.length, orb.get_primitive_tc(TCKind.tk_string));
        CorbaSequenceHandler obj = new CorbaSequenceHandler(new QName("Seq"), seqIdlType, seqTC, seqType);
View Full Code Here


        QName objIdlType = new QName(staxTestNamespaceURI, "TestSequence", staxTestPrefix);
        TypeCode objTypeCode = CorbaUtils.getTypeCode(orb, objIdlType, staxBindingImpl.getCorbaTypeMaps());
        CorbaTypeImpl type = CorbaUtils.getCorbaType(objIdlType, staxBindingImpl.getCorbaTypeMaps());
        assertTrue(type instanceof Sequence);

        Sequence seqType = (Sequence)type;
        CorbaSequenceHandler obj = new CorbaSequenceHandler(objName, objIdlType, objTypeCode, seqType);
        assertNotNull(obj);

        List<CorbaObjectHandler> objElements = new ArrayList<CorbaObjectHandler>();
        short seqData[] = { 1, 3, 5, 7 };
View Full Code Here

                                                 QName name, List<CorbaTypeMap> typeMaps) {
        QName seqElementType = null;
        long seqBound = 0;
        CorbaTypeImpl baseType = obj.getType();
        if (baseType instanceof Sequence) {
            Sequence seqType = (Sequence)baseType;
            seqElementType = seqType.getElemtype();
            seqBound = seqType.getBound();
        } else {
            Anonsequence seqType = (Anonsequence)baseType;
            seqElementType = seqType.getElemtype();
            seqBound = seqType.getBound();
        }
        if (seqBound == 0) {
            // This is an unbounded sequence.  Store a 'template' object that we can use to create
            // new objects as needed
            QName elementName = new QName(name.getNamespaceURI(), "item");
View Full Code Here

                mappingType.getStructOrExceptionOrUnion().add(aliasType);
            } else if (currentNode.getNodeName().equals("corba:array")) {
                Array arrayType = getArrayDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(arrayType);
            } else if (currentNode.getNodeName().equals("corba:sequence")) {
                Sequence sequenceType = getSequenceDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(sequenceType);
            } else if (currentNode.getNodeName().equals("corba:anonstring")) {
                Anonstring anonstringType = getAnonStringDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(anonstringType);
            } else if (currentNode.getNodeName().equals("corba:anonwstring")) {
View Full Code Here

        }
        return arrayType;
    }

    public Sequence getSequenceDefinition(Node node, Definition def) {
        Sequence sequenceType = new Sequence();

        // Store information about the sequence
        NamedNodeMap sequenceAttributes = node.getAttributes();
        for (int i = 0; i < sequenceAttributes.getLength(); ++i) {
            if (sequenceAttributes.item(i).getNodeName().equals("name")) {
                sequenceType.setName(sequenceAttributes.item(i).getNodeValue());
            } else if (sequenceAttributes.item(i).getNodeName().equals("repositoryID")) {
                sequenceType.setRepositoryID(sequenceAttributes.item(i).getNodeValue());
            } else if (sequenceAttributes.item(i).getNodeName().equals("elemtype")) {
                String elemType = sequenceAttributes.item(i).getNodeValue();
                int seperatorIndex = elemType.indexOf(':');
                String prefix = elemType.substring(0, seperatorIndex);
                String localPart = elemType.substring(seperatorIndex + 1, elemType.length());
                sequenceType.setElemtype(new QName(def.getNamespace(prefix), localPart, prefix));
            } else if (sequenceAttributes.item(i).getNodeName().equals("bound")) {
                sequenceType.setBound(Long.parseLong(sequenceAttributes.item(i).getNodeValue()));
            }
        }
        return sequenceType;
    }
View Full Code Here

            if (typeDefinition instanceof Anonsequence) {
                Anonsequence anonSeqType = (Anonsequence)typeDefinition;
                seqElementType = anonSeqType.getElemtype();
                bound = anonSeqType.getBound();
            } else {
                Sequence seqType = (Sequence)typeDefinition;
                seqElementType = seqType.getElemtype();
                bound = seqType.getBound();
            }
            StartElement seqStartEl = reader.nextEvent().asStartElement();
            obj = new CorbaSequenceHandler(seqStartEl.getName(), idlType, tc, typeDefinition);
            if (bound == 0) {
                LOG.log(Level.INFO, "Unbounded sequence found");
View Full Code Here

        return idlType;
    }
   
    private IdlType createSequence(CorbaTypeImpl ctype, IdlScopeBase scope, String local) {
        IdlType idlType = null;
        Sequence s = (Sequence)ctype;
        IdlType base = findType(s.getElemtype());       
        int bound = (int)s.getBound();
        idlType = IdlSequence.create(scope, local, base, bound);
        scope.addToScope(idlType);
        return idlType;
    }
View Full Code Here

            tc = orb.create_exception_tc(exceptType.getRepositoryID(), name, members);
        } else if (obj instanceof Fixed) {
            Fixed fixedType = (Fixed) obj;
            tc = orb.create_fixed_tc((short) fixedType.getDigits(), (short) fixedType.getScale());
        } else if (obj instanceof Sequence) {
            Sequence seqType = (Sequence)obj;
            tc = orb.create_sequence_tc((int) seqType.getBound(),
                                        getTypeCode(orb, seqType.getElemtype(), typeMaps));
        } else if (obj instanceof Struct) {
            Struct structType = (Struct)obj;

            // TODO: check to see if this is a recursive type.
            List list = structType.getMember();
View Full Code Here

TOP

Related Classes of org.apache.schemas.yoko.bindings.corba.Sequence

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.