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

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


    }
   
    private IdlType createConst(CorbaTypeImpl ctype, IdlScopeBase scope,
                                String local) throws Exception {
        IdlType idlType = null;
        Const c = (Const)ctype;
        IdlType base = findType(c.getIdltype());
        String value = c.getValue();
        idlType = IdlConst.create(scope, local, base, value);
        scope.addToScope(idlType);
        return idlType;
    }
View Full Code Here


        XmlSchemaType constSchemaType = visitor.getSchemaType();
        CorbaTypeImpl constCorbaType = visitor.getCorbaType();
        QName constCorbaTypeName = constCorbaType.getQName();
       
        // corba:const
        Const corbaConst = new Const();
        corbaConst.setQName(constQName);
        corbaConst.setValue(constValue);
        corbaConst.setType(constSchemaType.getQName());
        corbaConst.setIdltype(constCorbaTypeName);
       
        typeMap.getStructOrExceptionOrUnion().add(corbaConst);
    }
View Full Code Here

        // const types are guaranteed to be primitive types
        QName constCorbaTypeName = TypesUtils.findCorbaTypeName(typeMap, constTypeNode);
       
        // corba:const
        Const corbaConst = new Const();
        corbaConst.setQName(constQName);
        corbaConst.setValue(constValue);
        corbaConst.setType(constSchemaType.getQName());
        //corbaConst.setIdltype(constCorbaType.getQName());
        corbaConst.setIdltype(constCorbaTypeName);
       
        typeMap.getStructOrExceptionOrUnion().add(corbaConst);
    }
View Full Code Here

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

        }
        return mappingType;
    }

    public Const getConstDefinition(Node node, Definition def) {
        Const constType = new Const();
        NamedNodeMap constAttributes = node.getAttributes();

        // Store information about the const
        for (int i = 0; i < constAttributes.getLength(); ++i) {
            if (constAttributes.item(i).getNodeName().equals("name")) {
                constType.setName(constAttributes.item(i).getNodeValue());
            } else if (constAttributes.item(i).getNodeName().equals("value")) {
                constType.setValue(constAttributes.item(i).getNodeValue());
            } else if (constAttributes.item(i).getNodeName().equals("idltype")) {
                String idlType = constAttributes.item(i).getNodeValue();
                int seperatorIndex = idlType.indexOf(':');
                String prefix = idlType.substring(0, seperatorIndex);
                String localPart = idlType.substring(seperatorIndex + 1, idlType.length());
                constType.setIdltype(new QName(def.getNamespace(prefix), localPart, prefix));
            }
        }
        return constType;
    }
View Full Code Here

        } else if (obj instanceof Array) {
            Array arrayType = (Array)obj;
            tc = orb.create_array_tc((int) arrayType.getBound(),
                                     getTypeCode(orb, arrayType.getElemtype(), typeMaps));
        } else if (obj instanceof Const) {
            Const constType = (Const)obj;
            tc = getTypeCode(orb, constType.getIdltype(), typeMaps);
        } else if (obj instanceof Enum) {
            Enum enumType = (Enum)obj;
            String name = enumType.getName();
            List enums = enumType.getEnumerator();
            String[] members = new String[enums.size()];
View Full Code Here

TOP

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

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.