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

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


    }
   
    private IdlType createTypedef(CorbaTypeImpl ctype, IdlScopeBase scope,
                                  String local) throws Exception {
        IdlType idlType = null;
        Alias a = (Alias)ctype;
        IdlType base = findType(a.getBasetype());                              
        idlType = IdlTypedef.create(scope, local, base);
        scope.addToScope(idlType);
        return idlType;
    }
View Full Code Here


                    // Alias
                    //

                    nextSchemaType = duplicateXmlSchemaSimpleType(newScope);

                    Alias oldAlias = (Alias) oldCorbaType;
                    Alias alias = new Alias();

                    alias.setQName(newQname);
                    alias.setBasetype(oldAlias.getBasetype());
                    alias.setType(oldAlias.getType());
                    alias.setRepositoryID(newScope.toIDLRepositoryID());

                    nextCorbaType = alias;
                } else if (oldCorbaType instanceof Sequence) {
                    // Sequence
                    //
View Full Code Here

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

            } else {
                // unbounded string type is already in the XmlSchema and only needs to be added
                // to the CorbaTypeMap, therefore we cannot use DeclaratorVisitor here.
               
                while (identifierNode != null) {
                    Alias corbaString = new Alias();
                    if (typeDeclaratorNode.getType() == IDLTokenTypes.LITERAL_string) {
                        corbaString.setBasetype(CorbaConstants.NT_CORBA_STRING);
                    } else if (typeDeclaratorNode.getType() == IDLTokenTypes.LITERAL_wstring) {
                        corbaString.setBasetype(CorbaConstants.NT_CORBA_WSTRING);
                    } else {
                        // should never get here
                        throw new RuntimeException("[TypedefVisitor] Attempted to visit an invalid node: "
                                                   + typeDeclaratorNode.toString());
                    }
                    Scope newScope = new Scope(typedefScope.getParent(), identifierNode);
                    corbaString.setQName(new QName(typeMap.getTargetNamespace(), newScope.toString()));
                    corbaString.setType(Constants.XSD_STRING);
                    corbaString.setRepositoryID(newScope.toIDLRepositoryID());

                    typeMap.getStructOrExceptionOrUnion().add(corbaString);

                    identifierNode = identifierNode.getNextSibling();
                }
View Full Code Here

        // add xmlschema:simpleType
        setSchemaType(simpleType);

       
        // corba:alias
        Alias alias = new Alias();
        alias.setQName(new QName(typeMap.getTargetNamespace(), scopedName.toString()));
        alias.setBasetype(corbaType.getQName());
        alias.setType(schemaType.getQName());
        alias.setRepositoryID(scopedName.toIDLRepositoryID());
       
        // add corba:alias
        setCorbaType(alias);
    }
View Full Code Here

            switch (tc.kind().value()) {
            case TCKind._tk_alias:
                // For typedefs, we'll create the handler for the Object that is typedef'd.  Reading and
                // writing will use an Alias object and typecode, find the correct base type and then use
                // this handler to marshal/unmarshal data
                Alias aliasType = (Alias)type;
                handler = createTypeHandler(orb, name, aliasType.getBasetype(), typeMaps);
                break;
            case TCKind._tk_array:
                handler = new CorbaArrayHandler(name, idlType, tc, type);
                break;
            case TCKind._tk_enum:
View Full Code Here

                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")) {
View Full Code Here

       
        return branchType;
    }
   
    public Alias getAliasDefinition(Node node, Definition def) {
        Alias aliasType = new Alias();

        // Store information about the typedef
        NamedNodeMap aliasAttributes = node.getAttributes();
        for (int i = 0; i < aliasAttributes.getLength(); ++i) {
            if (aliasAttributes.item(i).getNodeName().equals("name")) {
                aliasType.setName(aliasAttributes.item(i).getNodeValue());
            } else if (aliasAttributes.item(i).getNodeName().equals("repositoryID")) {
                aliasType.setRepositoryID(aliasAttributes.item(i).getNodeValue());
            } else if (aliasAttributes.item(i).getNodeName().equals("basetype")) {
                String baseType = aliasAttributes.item(i).getNodeValue();
                int seperatorIndex = baseType.indexOf(':');
                String prefix = baseType.substring(0, seperatorIndex);
                String localPart = baseType.substring(seperatorIndex + 1, baseType.length());
                aliasType.setBasetype(new QName(def.getNamespace(prefix), localPart, prefix));
            }
        }
        return aliasType;
    }
View Full Code Here

        // We need to create an ObjectHandler from the base type of the typedef.  So we recursively call
        // the readObjectFromStax call.  However, this is not a true nested read so still pass false as the
        // nested flag.
        try {
            Alias aliasType = (Alias)typeDefinition;
            obj = readObjectFromStax(reader, aliasType.getBasetype(), false);
        } catch (java.lang.Exception ex) {
            LOG.log(Level.SEVERE, "Received exception while reading object of type " + idlType);
            throw new CorbaBindingException("Error while reading alias corba type", ex);
        }
        return obj;
View Full Code Here

        return struct;       
    }
   
    private IdlType createTypedef(CorbaTypeImpl ctype, IdlScopeBase scope, String local) {
        IdlType idlType = null;
        Alias a = (Alias)ctype;
        IdlType base = findType(a.getBasetype());       
       
        idlType = IdlTypedef.create(scope, local, base);
        scope.addToScope(idlType);
        return idlType;
    }
View Full Code Here

TOP

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

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.