Examples of Enum


Examples of org.apache.cxf.binding.corba.wsdl.Enum

    }

    // -- complex types --
    public void readEnum(CorbaObjectHandler obj) throws CorbaBindingException {
        int enumIndex = stream.read_long();
        Enum enumType = (Enum) obj.getType();
        List<Enumerator> enumerators = enumType.getEnumerator();

        CorbaEnumHandler enumObj = (CorbaEnumHandler)obj;
        enumObj.setValue(enumerators.get(enumIndex).getValue());
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.Enum

    }

    public void readEnumDiscriminator(CorbaUnionHandler unionHandler, CorbaEnumHandler disc)
        throws CorbaBindingException {
        int enumIndex = stream.read_long();
        Enum enumType = (Enum) disc.getType();
        List<Enumerator> enumerators = enumType.getEnumerator();
        if (enumIndex == Integer.MAX_VALUE) {
            enumIndex = unionHandler.getDefaultIndex();
        }
        disc.setValue(enumerators.get(enumIndex).getValue());
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.Enum

        return processPrimitiveType(qname);
    }

    private Enum createCorbaEnum(XmlSchemaSimpleTypeRestriction restrictionType, QName name,
                                 QName schematypeName) {
        Enum corbaEnum = new Enum();
        corbaEnum.setType(schematypeName);
        corbaEnum.setName(name.getLocalPart());
        corbaEnum.setQName(name);

        corbaEnum.setRepositoryID(REPO_STRING + name.getLocalPart().replace('.', '/') + IDL_VERSION);

        for (XmlSchemaFacet f : restrictionType.getFacets()) {
            XmlSchemaEnumerationFacet val = (XmlSchemaEnumerationFacet)f;
            Enumerator enumerator = new Enumerator();
            enumerator.setValue(val.getValue().toString());
            corbaEnum.getEnumerator().add(enumerator);
        }
        return corbaEnum;
    }
View Full Code Here

Examples of org.apache.cxf.binding.corba.wsdl.Enum

        List fields = processContainerAsMembers(choice, defaultName, schematypeName);

        List<String> caselist = new ArrayList<String>();

        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());
            }
View Full Code Here

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

        scope.addToScope(idlType);
        return idlType;
    }

    private IdlType createEnum(CorbaTypeImpl ctype, IdlScopeBase scope, String local) {
        Enum e = (Enum)ctype;
        IdlEnum enum1 = IdlEnum.create(scope, local);
        Iterator it = e.getEnumerator().iterator();

        while (it.hasNext()) {
            // Enumerators are created in the same scope
            // as the enum, according to IDL grammar rules.
            String n = ((Enumerator)it.next()).getValue();
View Full Code Here

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

        } else if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
            // Get the list of possible enumerations in the enumerator and compare these to the
            // labels we obtained from the Union definition.  In order for the union/enum
            // combination to be syntactically correct, there must be one enumeration not included
            // as a case for the default case to be valid.
            Enum enumType = (Enum)discriminator.getType();
            List<Enumerator> enumerators = enumType.getEnumerator();
            if (labels.isEmpty()) {
                // Any value will do since we only have a default case.
                label = enumerators.get(0).getValue();                 
            } else {
                String enumLabel = null;
View Full Code Here

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

    }
   
    public void setValue(String val) {
        value = val;
       
        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;
View Full Code Here

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

                                     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()];

            for (int i = 0; i < members.length; ++i) {
                members[i] = ((Enumerator) enums.get(i)).getValue();
            }
            tc = orb.create_enum_tc(enumType.getRepositoryID(), name, members);
        } else if (obj instanceof Exception) {
            Exception exceptType = (Exception)obj;

            // TODO: check to see if this is a recursive type.
            List list = exceptType.getMember();
View Full Code Here

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

                                                  TypeCode tc,
                                                  XmlSchemaObject schemaType)
        throws CorbaBindingException {
        CorbaEnumHandler obj = null;
        try {
            Enum enumType = (Enum) CorbaUtils.getCorbaType(idlType, typeMaps);
            StartElement enumStartEl = reader.nextEvent().asStartElement();
            obj = new CorbaEnumHandler(enumStartEl.getName(), idlType, tc, enumType);
            Characters enumCharEl = reader.nextEvent().asCharacters();
            obj.setValue(enumCharEl.getData());
            reader.nextEvent().asEndElement();
View Full Code Here

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

    public void testReadWriteStaxEnum() {       
        QName objName = new QName("object");
        QName objIdlType = new QName(staxTestNamespaceURI, "TestEnum", staxTestPrefix);
        CorbaTypeImpl type = CorbaUtils.getCorbaType(objIdlType, staxObject.getTypeMaps());
        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();
        }
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.