Package org.apache.yoko.wsdl

Examples of org.apache.yoko.wsdl.CorbaTypeImpl


                                                   TypeCode tc,
                                                   XmlSchemaObject schemaType)
        throws CorbaBindingException {
        CorbaFixedHandler obj = null;
        try {
            CorbaTypeImpl type = CorbaUtils.getCorbaType(idlType, typeMaps);
            StartElement fixedStartEl = reader.nextEvent().asStartElement();
            obj = new CorbaFixedHandler(fixedStartEl.getName(), idlType, tc, type);
            Characters fixedCharEl = reader.nextEvent().asCharacters();
            obj.setValueFromData(fixedCharEl.getData());
            reader.nextEvent().asEndElement();
View Full Code Here


                                                                schemas,
                                                                schema,
                                                                typeMap,
                                                                definition);
        visitor.visit(type);
        CorbaTypeImpl corbaType = visitor.getCorbaType();
       
        param.setIdltype(corbaType.getQName());
       
        return param;
    }
View Full Code Here

                                                                schemas,
                                                                schema,
                                                                typeMap,
                                                                definition);
        visitor.visit(type);
        CorbaTypeImpl corbaType = visitor.getCorbaType();
       
        param.setIdltype(corbaType.getQName());

        return param;
    }
View Full Code Here

        // <octet_type> ::= "octet"
        // <any_type> ::= "any"
       
        XmlSchemaType stype = null;
        CorbaTypeImpl ctype = null;
        QName corbaTypeQName = PrimitiveTypesVisitor.getPrimitiveType(node);
        if (corbaTypeQName != null) {
            QName schemaTypeQName = xmlSchemaPrimitiveMap.get(corbaTypeQName);
            if (schemaTypeQName != null) {
                //XmlSchemaCollection schemas = new XmlSchemaCollection();
                stype = schemas.getTypeByQName(schemaTypeQName);
                if (stype != null) {
                    ctype = new CorbaTypeImpl();
                    ctype.setQName(corbaTypeQName);
                    ctype.setType(stype.getQName());
                    ctype.setName(stype.getQName().getLocalPart());
                }
            }
        }

       
View Full Code Here

                                                                    definition);

            visitor.visit(node);
           
            XmlSchemaType schemaType = visitor.getSchemaType();
            CorbaTypeImpl corbaType = visitor.getCorbaType();
           
            boolean isObjectReference = false;
            if (corbaType instanceof org.apache.schemas.yoko.bindings.corba.Object) {
                isObjectReference = true;
            }
View Full Code Here

        // using TypesVisitor to visit <const_type>
        // it should be visited by a ConstTypeVisitor
        TypesVisitor visitor = new TypesVisitor(getScope(), schemas, schema, typeMap, constNameNode);
        visitor.visit(constTypeNode);
        XmlSchemaType constSchemaType = visitor.getSchemaType();
        CorbaTypeImpl constCorbaType = visitor.getCorbaType();
        QName constCorbaTypeName = constCorbaType.getQName();
       
        // corba:const
        Const corbaConst = new Const();
        corbaConst.setQName(constQName);
        corbaConst.setValue(constValue);
View Full Code Here

        AST memberTypeNode = identifierNode.getNextSibling();
        while (memberTypeNode != null) {
            AST memberNode = TypesUtils.getCorbaTypeNameNode(memberTypeNode);
           
            XmlSchemaType schemaType = null;
            CorbaTypeImpl corbaType = null;
            try {
                TypesVisitor visitor = new TypesVisitor(structScope,
                                                        schemas,
                                                        schema,
                                                        typeMap,
                                                        null);
                visitor.visit(memberTypeNode);
               
                schemaType = visitor.getSchemaType();
                corbaType = visitor.getCorbaType();
               
            } catch (Exception ex) {
                System.out.println(ex.getMessage());
                System.exit(1);
            }

            // needed for anonymous arrays in structs
            if (ArrayVisitor.accept(memberNode)) {
                Scope anonScope = new Scope(structScope,
                                            TypesUtils.getCorbaTypeNameNode(memberTypeNode));
                ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
                                                             schemas,
                                                             schema,
                                                             typeMap,
                                                             schemaType,
                                                             corbaType,
                                                             null);
                arrayVisitor.visit(memberNode);
                schemaType = arrayVisitor.getSchemaType();
                corbaType = arrayVisitor.getCorbaType();
            }
           
            // xmlschema:member
            XmlSchemaElement member = new XmlSchemaElement();
            String memberName = memberNode.toString();
            member.setName(memberName);
            member.setSchemaType(schemaType);
            member.setSchemaTypeName(schemaType.getQName());

            sequence.getItems().add(member);

           
            // corba:member
            MemberType memberType = new MemberType();
            memberType.setName(memberName);
            memberType.setIdltype(corbaType.getQName());
            struct.getMember().add(memberType);

            memberTypeNode = memberNode.getNextSibling();
        }
View Full Code Here

       
       
        //String anonstringName = new String("_1_" + stringScopedName.toString());
        Scope anonstringScopedName = new Scope(getScope(), "_1_" + stringScopedName.tail());
        String anonstringName = anonstringScopedName.toString();
        CorbaTypeImpl anon = null;
        if (stringNode.getType() == IDLTokenTypes.LITERAL_string) {
            // corba:anonstring
            Anonstring anonstring = new Anonstring();
            anonstring.setQName(new QName(typeMap.getTargetNamespace(), anonstringName));
            anonstring.setBound(new Long(boundNode.toString()));
            anonstring.setType(simpleType.getQName());

            anon = anonstring;
           
        } else if (stringNode.getType() == IDLTokenTypes.LITERAL_wstring) {
            // corba:anonwstring
            Anonwstring anonwstring = new Anonwstring();
            anonwstring.setQName(new QName(typeMap.getTargetNamespace(), anonstringName));
            anonwstring.setBound(new Long(boundNode.toString()));
            anonwstring.setType(simpleType.getQName());
           
            anon = anonwstring;
           
        } else {
            // should never get here
            throw new RuntimeException("StringVisitor attempted to visit an invalid node");
        }
       
        // add corba:anonstring
        typeMap.getStructOrExceptionOrUnion().add(anon);

        // corba:alias
        Alias alias = new Alias();
        alias.setQName(new QName(typeMap.getTargetNamespace(), stringScopedName.toString()));
        alias.setBasetype(anon.getQName());
        alias.setType(simpleType.getQName());
        alias.setRepositoryID(stringScopedName.toIDLRepositoryID());

        // add corba:alias
        setCorbaType(alias);
View Full Code Here

        // schema type
        setSchemaType(schemas.getTypeByQName(Constants.XSD_STRING));

       
        // corba type
        CorbaTypeImpl corbaString = new CorbaTypeImpl();
        if (stringNode.getType() == IDLTokenTypes.LITERAL_string) {
            corbaString.setQName(CorbaConstants.NT_CORBA_STRING);
            corbaString.setName(CorbaConstants.NT_CORBA_STRING.getLocalPart());
        } else if (stringNode.getType() == IDLTokenTypes.LITERAL_wstring) {
            corbaString.setQName(CorbaConstants.NT_CORBA_WSTRING);
            corbaString.setName(CorbaConstants.NT_CORBA_WSTRING.getLocalPart());
        } else {
            // should never get here
            throw new RuntimeException("StringVisitor attempted to visit an invalid node");
        }
        corbaString.setType(Constants.XSD_STRING);

        setCorbaType(corbaString);
    }
View Full Code Here

        // <scoped_name> ::= <identifier>
        //                 | :: <identifier>
        //                 | <scoped_name> "::" <identifier>

        XmlSchemaType stype = null;
        CorbaTypeImpl ctype = null;
       
        if (PrimitiveTypesVisitor.accept(node)) {
            // primitive type
           
            PrimitiveTypesVisitor primitiveVisitor = new PrimitiveTypesVisitor(null, schemas);
            primitiveVisitor.visit(node);
           
            stype = primitiveVisitor.getSchemaType();
            ctype = primitiveVisitor.getCorbaType();
        } else {
            // declared type
            Scope currentScope = getScope();
            while (stype == null
                && currentScope != currentScope.getParent()) {
                // A name can be used in an unqualified form within a particular scope;
                // it will be resolved by successvely searching farther out in enclosing
                // scopes, while taking into consideration inheritance relationships
                // among interfaces.
                // INHERITANCE NOT IMPLEMENTED YET
                Scope scopedName = new Scope(currentScope, node);
                QName schemaQName = new QName(schema.getTargetNamespace(), scopedName.toString());

                stype = schema.getTypeByName(schemaQName);

                currentScope = currentScope.getParent();
            }
            if (stype == null) {
                // Global scope is our last chance to resolve the node
                QName schemaQName = new QName(schema.getTargetNamespace(), node.toString());
                stype = schema.getTypeByName(schemaQName);
            }
               
            // handle special case of simple string alias
            // a plain xsd:string has no corresponding XmlSchemaType in the XmlSchema
            // so the previous findType() method would return null.
            // As a temporary workaround, we query the typeMap for a corba:string with
            // same name. If the string is there, then it had been previously properly
            // declared and we can use it here.
            if (stype == null) {
                QName corbaQName = null;
                currentScope = getScope();
                while (ctype == null
                    && currentScope != currentScope.getParent()) {
                    Scope scopedName = new Scope(currentScope, node);
                    corbaQName = new QName(typeMap.getTargetNamespace(), scopedName.toString());
                    ctype = findCorbaType(typeMap, corbaQName);
                   
                    currentScope = currentScope.getParent();
                }
                if (ctype == null) {
                    corbaQName = new QName(typeMap.getTargetNamespace(), node.toString());
                    ctype = findCorbaType(typeMap, corbaQName);                   
                }
                if (ctype != null && ctype.getType() == Constants.XSD_STRING) {
                    stype = schemas.getTypeByQName(Constants.XSD_STRING);
                    ctype = new CorbaTypeImpl();
                    ctype.setName(CorbaConstants.NT_CORBA_STRING.getLocalPart());
                    ctype.setQName(CorbaConstants.NT_CORBA_STRING);
                    ctype.setType(Constants.XSD_STRING);
                } else {
                    throw new RuntimeException("[ScopedNameVisitor: Corba type "
                                               + corbaQName.toString()
                                               + " not found in typeMap]");
                }
View Full Code Here

TOP

Related Classes of org.apache.yoko.wsdl.CorbaTypeImpl

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.