Examples of CorbaTypeImpl


Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        // <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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        // 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 (result == null) {
            CorbaTypeImpl ctype = null;
            currentScope = scope;
            while (ctype == null
                && currentScope != currentScope.getParent()) {
                QName corbaStringQname = new QName(typeMap.getTargetNamespace(), currentScope.toString());
                ctype = findCorbaType(typeMap, corbaStringQname);
                currentScope = currentScope.getParent();
            }
            if (ctype == null) {
                QName corbaStringQname = new QName(typeMap.getTargetNamespace(), node.toString());
                ctype = findCorbaType(typeMap, corbaStringQname);               
            }
            if (ctype != null
                && ctype.getType() == Constants.XSD_STRING) {
                result = schemas.getTypeByQName(Constants.XSD_STRING);
            }
        }
        return result;
    }
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        }
        return result;
    }
   
    public static CorbaTypeImpl findCorbaType(TypeMappingType typeMap, QName schemaTypeName) {
        CorbaTypeImpl result = null;
        Iterator corbaTypes = typeMap.getStructOrExceptionOrUnion().iterator();
        while (corbaTypes.hasNext()) {
            CorbaTypeImpl type = (CorbaTypeImpl) corbaTypes.next();
            if (type.getQName().getLocalPart().equals(schemaTypeName.getLocalPart())) {
                result = type;
                break;
            }
        }
        return result;
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

                                                    schema,
                                                    typeMap,
                                                    null);
            visitor.visit(memberTypeNode);
            XmlSchemaType stype = visitor.getSchemaType();
            CorbaTypeImpl ctype = visitor.getCorbaType();
           
            // needed for anonymous arrays in exceptions
            if (ArrayVisitor.accept(memberNode)) {
                Scope anonScope = new Scope(exceptionScope,
                                            TypesUtils.getCorbaTypeNameNode(memberTypeNode));
                ArrayVisitor arrayVisitor = new ArrayVisitor(anonScope,
                                                             schemas,
                                                             schema,
                                                             typeMap,
                                                             stype,
                                                             ctype,
                                                             null);
                arrayVisitor.visit(memberNode);
                stype = arrayVisitor.getSchemaType();
                ctype = arrayVisitor.getCorbaType();
            }

            // xmlschema:member
            XmlSchemaElement member = new XmlSchemaElement();
            String memberName = memberNode.toString();
            member.setName(memberName);
            member.setSchemaType(stype);
            member.setSchemaTypeName(stype.getQName());

            sequence.getItems().add(member);

           
            // corba:member
            MemberType memberType = new MemberType();
            memberType.setName(memberName);
            memberType.setIdltype(ctype.getQName());
            exception.getMember().add(memberType);
           
           
            memberTypeNode = memberNode.getNextSibling();
        }
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        // Get the list of all corba types already defined and look for the provided
        // QName.  If we have defined this type, we don't need to add it to the typemap
        // again.
        List<CorbaTypeImpl> allTypes = typeMap.getStructOrExceptionOrUnion();
        for (Iterator<CorbaTypeImpl> iter = allTypes.iterator(); iter.hasNext();) {
            CorbaTypeImpl impl = iter.next();
            if (impl.getQName().equals(objectReferenceName))  {
                return true;
            }
        }
        return false;
    }
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        corbaPrimitiveMap.put("anyType", CorbaConstants.NT_CORBA_ANY);
       
    }
   
    public Object get(QName key) {
        CorbaTypeImpl corbaTypeImpl = null;

        QName type = corbaPrimitiveMap.get(key.getLocalPart());
        if (type != null) {
            corbaTypeImpl = new CorbaTypeImpl();
            corbaTypeImpl.setQName(type);
            corbaTypeImpl.setType(key);
            corbaTypeImpl.setName(key.getLocalPart());
        }
       
        return corbaTypeImpl;       
    }
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

        }
       
        // process first array
        Long size = new Long(firstSizeNode.toString());
        XmlSchemaType stype = null;
        CorbaTypeImpl ctype = null;
        if (identifierNode != null) {
            Scope scopedName = getScope();
            stype = generateSchemaArray(scopedName.toString(), size, result.getSchemaType().getQName());
            ctype = generateCorbaArray(scopedName, size, result.getCorbaType().getQName());
        } else {
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

                                                                schema,
                                                                typeMap,
                                                                wsdlDefinition);
        visitor.visit(typeNode);
        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

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

                                                                  typeMap,
                                                                  null);
        visitor.visit(simpleTypeSpecNode);
       
        XmlSchemaType stype = visitor.getSchemaType();
        CorbaTypeImpl ctype = visitor.getCorbaType();
       

        long bound = -1;
        if (boundNode != null) {
            bound = Long.parseLong(boundNode.toString());
        }

        Scope scopedName = null;
        if (identifierNode == null) {
            // anonymous type
            scopedName = TypesUtils.generateAnonymousScopedName(getScope(), schema);
        } else {
            scopedName = new Scope(getScope(), identifierNode);
        }

        XmlSchemaType schemaType = null;
        if (stype != schemas.getTypeByQName(Constants.XSD_UNSIGNEDBYTE)) {
            schemaType = generateSchemaType(stype, scopedName, bound);
        } else {
            // According to CORBA Binding for WSDL specification,
            // idl:sequence<octet> maps to xs:base64Binary by default.
            schemaType = schemas.getTypeByQName(Constants.XSD_BASE64);
        }
       
        CorbaTypeImpl corbaType = null;
        if (identifierNode == null) {
            corbaType = generateCorbaAnonsequence(ctype,
                                                  schemaType,
                                                  scopedName,
                                                  bound);
View Full Code Here

Examples of org.apache.yoko.wsdl.CorbaTypeImpl

       
        TypesVisitor typesVisitor = new TypesVisitor(getScope(), schemas, schema, typeMap, identifierNode);
        typesVisitor.visit(typeDeclaratorNode);

        XmlSchemaType schemaType = typesVisitor.getSchemaType();
        CorbaTypeImpl corbaType = typesVisitor.getCorbaType();
       
        Scope typedefScope = new Scope(getScope(), identifierNode);
       
        if (SequenceVisitor.accept(typeDeclaratorNode)
            || FixedVisitor.accept(typeDeclaratorNode)) {
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.