Examples of CorbaEnumHandler


Examples of org.apache.yoko.bindings.corba.types.CorbaEnumHandler

        }
    }
   
    public CorbaObjectHandler readEnumFromStax(XMLEventReader reader, QName idlType, TypeCode tc)
        throws CorbaBindingException {
        CorbaEnumHandler obj = null;
        CorbaTypeImpl typeDefinition = CorbaUtils.getCorbaType(idlType, typeMaps);
       
        try {
            Enum enumType = (Enum)typeDefinition;
            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();
        } catch (java.lang.Exception ex) {
            LOG.log(Level.SEVERE, "Received exception while reading object of type " + idlType);
            throw new CorbaBindingException("Error while reading enum corba type", ex);
        }
View Full Code Here

Examples of org.apache.yoko.bindings.corba.types.CorbaEnumHandler

        return obj;
    }
   
    public void writeEnumToStax(CorbaObjectHandler obj, XMLEventWriter writer, XMLEventFactory factory)
        throws XMLStreamException {
        CorbaEnumHandler enumHandler = (CorbaEnumHandler)obj;
        Characters charEvt = factory.createCharacters(enumHandler.getValue());
        writer.add(charEvt);
    }
View Full Code Here

Examples of org.apache.yoko.bindings.corba.types.CorbaEnumHandler

        stream.write_any(a);
    }

    // -- complex types --
    public void writeEnum(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaEnumHandler enumHandler = (CorbaEnumHandler)obj;
        Enum enumType = (Enum)enumHandler.getType();
        String enumLabel = enumHandler.getValue();
        List<Enumerator> enumerators = enumType.getEnumerator();
       
        // We won't use an iterator here so that we have the index number of the enumerator string.
        // This is how CORBA references enums when reading and writing to streams.
        for (int i = 0; i < enumerators.size(); ++i) {
View Full Code Here

Examples of org.apache.yoko.bindings.corba.types.CorbaEnumHandler

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