Examples of TypeMappingType


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

            assertNotNull(typemap);
            assertEquals(4, typemap.getElementsByTagName("corba:union").getLength());
            assertEquals(23, typemap.getElementsByTagName("corba:struct").getLength());
            assertEquals(1, typemap.getElementsByTagName("corba:anonstring").getLength());
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("TypeInheritanceCORBABinding");
            idlgen.setOutputFile("nested.idl");
            idlgen.generateIDL(model);
View Full Code Here

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

            Element typemap = getElementNode(document, "corba:typeMapping");           
            assertNotNull(typemap);
            assertEquals(2, typemap.getElementsByTagName("corba:union").getLength());
            assertEquals(1, typemap.getElementsByTagName("corba:struct").getLength());           
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("NillableCORBABinding");
            idlgen.setOutputFile("nillable.idl");
            idlgen.generateIDL(model);
           
            Union un = (Union)mapType.getStructOrExceptionOrUnion().get(2);
            assertEquals("Name is incorrect for Union Type", "long_nil",
                         un.getName());
            assertEquals("Type is incorrect for Union Type", "PEl",
                         un.getType().getLocalPart());
            Unionbranch unbranch = un.getUnionbranch().get(0);
View Full Code Here

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

            assertNotNull(typemap);
            assertEquals(3, typemap.getElementsByTagName("corba:union").getLength());           
            assertEquals(1, typemap.getElementsByTagName("corba:anonstring").getLength());           
            assertEquals(17, typemap.getElementsByTagName("corba:struct").getLength());           
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("TypeInheritanceCORBABinding");
            idlgen.setOutputFile("typeInherit.idl");
            idlgen.generateIDL(model);

            Anonstring str = (Anonstring)mapType.getStructOrExceptionOrUnion().get(6);
            assertEquals("Name is incorrect for AnonString Type", "attrib2Type",
                         str.getName());
            assertEquals("Type is incorrect for AnonString Type", "string",
                         str.getType().getLocalPart());           

            Union un = (Union)mapType.getStructOrExceptionOrUnion().get(7);
            assertEquals("Name is incorrect for Union Type", "attrib2Type_nil",
                         un.getName());
            assertEquals("Type is incorrect for Union Type", "attrib2",
                         un.getType().getLocalPart());
            Unionbranch unbranch = un.getUnionbranch().get(0);
View Full Code Here

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

            assertNotNull(typemap);
            assertEquals(1, typemap.getElementsByTagName("corba:anonfixed").getLength());           
            assertEquals(1, typemap.getElementsByTagName("corba:anonstring").getLength());           
            assertEquals(3, typemap.getElementsByTagName("corba:struct").getLength());           
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("XCORBABinding");
            idlgen.setOutputFile("atype.idl");
            idlgen.generateIDL(model);

            Anonstring str = (Anonstring)mapType.getStructOrExceptionOrUnion().get(1);
            assertEquals("Name is incorrect for Array Type", "X._1_S",
                         str.getName());
            assertEquals("Type is incorrect for AnonString Type", "string",
                         str.getType().getLocalPart());
           
            Anonfixed fx = (Anonfixed)mapType.getStructOrExceptionOrUnion().get(2);
            assertEquals("Name is incorrect for Anon Array Type", "X._2_S",
                         fx.getName());
            assertEquals("Type is incorrect for AnonFixed Type", "decimal",
                         fx.getType().getLocalPart());
           
            Struct struct = (Struct)mapType.getStructOrExceptionOrUnion().get(0);
            assertEquals("Name is incorrect for Anon Array Type", "X.S",
                         struct.getName());           
            assertEquals("Type is incorrect for Struct Type", "X.S",
                         struct.getType().getLocalPart());
            assertEquals("Name for first Struct Member Type is incorrect", "str",
View Full Code Here

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

            assertEquals(3, typemap.getElementsByTagName("corba:anonsequence").getLength());           
            assertEquals(2, typemap.getElementsByTagName("corba:anonarray").getLength());
            assertEquals(1, typemap.getElementsByTagName("corba:array").getLength());
            assertEquals(2, typemap.getElementsByTagName("corba:struct").getLength());           
           
            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);           

            WSDLToIDLAction idlgen = new WSDLToIDLAction();
            idlgen.setBindingName("XCORBABinding");
            idlgen.setOutputFile("atype.idl");
            idlgen.generateIDL(model);

            Array arr = (Array)mapType.getStructOrExceptionOrUnion().get(0);           
            assertEquals("ElementType is incorrect for Array Type", "X._5_A",
                         arr.getElemtype().getLocalPart());
           
            Anonarray arr2 = (Anonarray)mapType.getStructOrExceptionOrUnion().get(3);
            assertEquals("ElementType is incorrect for Anon Array Type", "X._4_A",
                         arr2.getElemtype().getLocalPart());
           
            Anonarray arr3 = (Anonarray)mapType.getStructOrExceptionOrUnion().get(2);
            assertEquals("ElementType is incorrect for Anon Array Type", "X._1_A",
                         arr3.getElemtype().getLocalPart());
           
           
            Anonsequence seq = (Anonsequence)mapType.getStructOrExceptionOrUnion().get(5);
            assertEquals("Name is incorrect for Anon Array Type", "X._1_A",
                         seq.getName());                       
            assertEquals("ElementType is incorrect for Anon Sequence Type", "X._2_A",
                         seq.getElemtype().getLocalPart());
           
           
            Anonsequence seq2 = (Anonsequence)mapType.getStructOrExceptionOrUnion().get(1);
            assertEquals("Name is incorrect for Anon Array Type", "X._2_A",
                         seq2.getName());                       
            assertEquals("ElementType is incorrect for Anon Sequence Type", "X._3_A",
                         seq2.getElemtype().getLocalPart());
           
            Anonsequence seq3 = (Anonsequence)mapType.getStructOrExceptionOrUnion().get(4);
            assertEquals("Name is incorrect for Anon Array Type", "X._3_A",
                         seq3.getName());
            assertEquals("ElementType is incorrect for Anon Sequence Type", "long",
                         seq3.getElemtype().getLocalPart());
           
View Full Code Here

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

            String fileName = getClass().getResource("/wsdl/any.wsdl").toString();
            generator.setWsdlFile(fileName);
            generator.addInterfaceName("anyInterface");           
            Definition model = generator.generateCORBABinding();

            TypeMappingType mapType = (TypeMappingType)model.getExtensibilityElements().get(0);
            assertEquals(5, mapType.getStructOrExceptionOrUnion().size());
            Iterator i = mapType.getStructOrExceptionOrUnion().iterator();
            int strcnt = 0;
            int unioncnt = 0;
            while (i.hasNext()) {
                CorbaTypeImpl corbaType = (CorbaTypeImpl)i.next();
                if (corbaType instanceof Struct) {
View Full Code Here

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

        schema.getItems().add(element);
        schema.getItems().add(complexType);
       
       
        // add exception to corba typemap
        TypeMappingType typeMap = getCorbaTypeMap();
        typeMap.getStructOrExceptionOrUnion().add(exception);
       
        setSchemaType(complexType);
        setCorbaType(exception);
    }
View Full Code Here

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

    public ExtensibilityElement unmarshall(Class parentType, QName elementType,
                                           Element el, Definition def,
                                           ExtensionRegistry extReg)
        throws WSDLException {
        TypeMappingType mappingType = new TypeMappingType();

        // Store the target namespace for the types
        NamedNodeMap mappingAttributes = el.getAttributes();
        for (int i = 0; i < mappingAttributes.getLength(); ++i) {
            if (mappingAttributes.item(i).getNodeName().equals("targetNamespace")) {
                mappingType.setTargetNamespace(mappingAttributes.item(i).getNodeValue());
            }
        }

        // Get the types that are stored in this typemapping
        NodeList typeChildNodes = el.getChildNodes();
        for (int i = 0; i < typeChildNodes.getLength(); ++i) {
            Node currentNode = typeChildNodes.item(i);

            if (currentNode.getNodeName().equals("corba:const")) {
                Const constType = getConstDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(constType);
            } else if (currentNode.getNodeName().equals("corba:enum")) {
                Enum enumType = getEnumDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(enumType);
            } else if (currentNode.getNodeName().equals("corba:struct")) {
                Struct structType = getStructDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(structType);
            } else if (currentNode.getNodeName().equals("corba:exception")) {
                Exception exceptType = getExceptionDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(exceptType);
            } else if (currentNode.getNodeName().equals("corba:fixed")) {
                Fixed fixedType = getFixedDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(fixedType);
            } else if (currentNode.getNodeName().equals("corba:union")) {
                Union unionType = getUnionDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(unionType);
            } else if (currentNode.getNodeName().equals("corba:alias")) {
                Alias aliasType = getAliasDefinition(currentNode, def);
                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")) {
                Anonstring anonstringType = getAnonWStringDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(anonstringType);
            } else if (currentNode.getNodeName().equals("corba:anonfixed")) {
                Anonfixed anonfixedType = getAnonFixedDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(anonfixedType);
            } else if (currentNode.getNodeName().equals("corba:anonsequence")) {
                Anonsequence anonsequenceType = getAnonSequenceDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(anonsequenceType);
            } else if (currentNode.getNodeName().equals("corba:anonarray")) {
                Anonarray anonarrayType = getAnonArrayDefinition(currentNode, def);
                mappingType.getStructOrExceptionOrUnion().add(anonarrayType);
            } else {
                // TODO: How do we want to handle this?
            }
        }
        return mappingType;
View Full Code Here

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

    private void getAllIdlTypes() throws Exception {

        try {
            Iterator types = def.getExtensibilityElements().iterator();
            TypeMappingType typeMappingType = null;           
            if (types != null) {
                while (types.hasNext()) {                   
                    typeMappingType = (TypeMappingType)types.next();
                }
            }
            if (typeMappingType != null) {
                Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
                while (i.hasNext()) {
                    CorbaTypeImpl corbaTypeImpl = (CorbaTypeImpl)i.next();                               
                    findCorbaIdlType(corbaTypeImpl);
                }
            }
View Full Code Here

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

        CorbaTypeImpl corbaTypeImpl = null;

        try {

            Iterator types = def.getExtensibilityElements().iterator();
            TypeMappingType typeMappingType = null;
            if (types != null) {
                while (types.hasNext()) {
                    typeMappingType = (TypeMappingType)types.next();
                }
            }
            Iterator i = typeMappingType.getStructOrExceptionOrUnion().iterator();
            while (i.hasNext()) {
                CorbaTypeImpl corbaType = (CorbaTypeImpl)i.next();               
                //if (corbaType.getType().getLocalPart().equals(qname.getLocalPart())) {               
                if (corbaType.getName().equals(qname.getLocalPart())) {                   
                    return corbaType;
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.