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

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


       
        Enum enumType = (Enum)this.type;
        List<Enumerator> enumerators = enumType.getEnumerator();
        index = -1;
        for (int i = 0; i < enumerators.size(); ++i) {
            Enumerator e = enumerators.get(i);
            if (e.getValue().equals(val)) {
                index = i;
                break;
            }
        }
    }
View Full Code Here


        assertTrue(type instanceof Enum);
        Enum enumType = (Enum)type;
        List<Enumerator> enumerators = enumType.getEnumerator();
        String[] enums = new String[enumerators.size()];
        for (int i = 0; i < enumerators.size(); ++i) {
            Enumerator e = enumerators.get(i);
            enums[i] = e.getValue();
        }
        TypeCode objTypeCode = CorbaUtils.getTypeCode(orb, objIdlType, staxObject.getTypeMaps());
        CorbaEnumHandler obj = new CorbaEnumHandler(objName, objIdlType, objTypeCode, enumType);
        assertNotNull(obj);
       
View Full Code Here

        InputStream iStream = oStream.create_input_stream();
        CorbaObjectReader reader = new CorbaObjectReader(iStream);
       
        String[] enums = {"RED", "GREEN", "BLUE" };
        Enum enumType = new Enum();
        Enumerator enumRed = new Enumerator();
        enumRed.setValue(enums[0]);
        Enumerator enumGreen = new Enumerator();
        enumGreen.setValue(enums[1]);
        Enumerator enumBlue = new Enumerator();
        enumBlue.setValue(enums[2]);
        enumType.getEnumerator().add(enumRed);
        enumType.getEnumerator().add(enumGreen);
        enumType.getEnumerator().add(enumBlue);
       
        // These values don't matter to the outcome of the test but are needed during construction
View Full Code Here

            XmlSchemaEnumerationFacet enumeration = new XmlSchemaEnumerationFacet();
            enumeration.setValue(node.toString());
            enumSchemaSimpleTypeRestriction.getFacets().add(enumeration);

            // corba:enumerator
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(node.toString());
            corbaEnum.getEnumerator().add(enumerator);
           
            node = node.getNextSibling();
        }
       
View Full Code Here

    public void testCorbaEnumHandler() {
        Enum enumType = new Enum();
        enumType.setName("EnumType");
        enumType.setRepositoryID("IDL:EnumType:1.0");
       
        Enumerator enumerator0 = new Enumerator();
        enumerator0.setValue("ENUM0");
        Enumerator enumerator1 = new Enumerator();
        enumerator1.setValue("ENUM1");
        Enumerator enumerator2 = new Enumerator();
        enumerator2.setValue("ENUM2");
        enumType.getEnumerator().add(enumerator0);
        enumType.getEnumerator().add(enumerator1);
        enumType.getEnumerator().add(enumerator2);
       
        QName enumName = new QName("EnumType");
        QName enumIdlType =
            new QName(CorbaConstants.NU_WSDL_CORBA, "EnumType", CorbaConstants.NP_WSDL_CORBA);
        String members[] = new String[3];
        members[0] = enumerator0.getValue();
        members[1] = enumerator1.getValue();
        members[2] = enumerator2.getValue();
        TypeCode enumTC = orb.create_enum_tc(enumType.getRepositoryID(), enumType.getName(), members);
       
        CorbaEnumHandler obj = new CorbaEnumHandler(enumName, enumIdlType, enumTC, enumType);
        assertNotNull(obj);
       
View Full Code Here

        corbaEnum.setRepositoryID(REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION);
        Iterator enums = restrictionType.getFacets().getIterator();

        while (enums.hasNext()) {
            XmlSchemaEnumerationFacet val = (XmlSchemaEnumerationFacet)enums.next();
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(val.getValue().toString());
            corbaEnum.getEnumerator().add(enumerator);
        }
        return corbaEnum;
    }
View Full Code Here

        if (disctype instanceof Enum) {
            Enum corbaenum = (Enum)disctype;
            Iterator iterator = corbaenum.getEnumerator().iterator();

            while (iterator.hasNext()) {
                Enumerator enumerator = (Enumerator)iterator.next();
                caselist.add(enumerator.getValue());
            }
        } else if (SUPPORTEDDISTYPES.contains(disctype.getQName().getLocalPart())) {
            if (disctype.getQName().getLocalPart().equals("long")
                || disctype.getQName().getLocalPart().equals("short")) {
                for (int i = 0; i < fields.size(); i++) {
View Full Code Here

            XmlSchemaEnumerationFacet enumeration = new XmlSchemaEnumerationFacet();
            enumeration.setValue(node.toString());
            enumSchemaSimpleTypeRestriction.getFacets().add(enumeration);

            // corba:enumerator
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(node.toString());
            corbaEnum.getEnumerator().add(enumerator);
           
            node = node.getNextSibling();
        }
       
View Full Code Here

        assertTrue(type instanceof Enum);
        Enum enumType = (Enum)type;
        List<Enumerator> enumerators = enumType.getEnumerator();
        String[] enums = new String[enumerators.size()];
        for (int i = 0; i < enumerators.size(); ++i) {
            Enumerator e = enumerators.get(i);
            enums[i] = e.getValue();
        }
        TypeCode objTypeCode = CorbaUtils.getTypeCode(orb, objIdlType, staxBindingImpl.getCorbaTypeMaps());
        CorbaEnumHandler obj = new CorbaEnumHandler(objName, objIdlType, objTypeCode, enumType);
        assertNotNull(obj);
       
View Full Code Here

           
            // The spec uses corba:enumeration but the tool we have uses corba:enumerator.
            // REVISIT: Which one is correct?
            //if (currentNode.getNodeName().equals("corba:enumeration")) {
            if (currentNode.getNodeName().equals("corba:enumerator")) {
                Enumerator enumerator = new Enumerator();
                NamedNodeMap enumeratorAttrs = currentNode.getAttributes();

                for (int j = 0; j < enumeratorAttrs.getLength(); ++j) {
                    Node enumeratorAttrNode = enumeratorAttrs.item(j);
                    if (enumeratorAttrNode.getNodeName().equals("value")) {
                        enumerator.setValue(enumeratorAttrNode.getNodeValue());
                    }
                }
                enumType.getEnumerator().add(enumerator);
            }
        }
View Full Code Here

TOP

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

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.