Package org.apache.tuscany.sca.binding.corba.meta

Examples of org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement


            return false;
        }
        boolean atLeastOneOption = false;
        boolean discriminatorPresent = false;
        for (int i = 0; i < forClass.getDeclaredFields().length; i++) {
            CorbaUnionElement note = forClass.getDeclaredFields()[i].getAnnotation(CorbaUnionElement.class);
            if (note != null) {
                int fieldMod = forClass.getDeclaredFields()[i].getModifiers();
                if (Modifier.isPrivate(fieldMod) && !Modifier.isFinal(fieldMod) && !Modifier.isStatic(fieldMod)) {
                    if (note.type().equals(CorbaUnionElementType.discriminator)) {
                        if (discriminatorPresent) {
                            throw new RequestConfigurationException(
                                                                    "More than one discriminators declared on: " + forClass);
                        }
                        discriminatorPresent = true;
View Full Code Here


     * @throws RequestConfigurationException
     */
    private static UnionAttributes getUnionAttributes(Class<?> forClass) throws RequestConfigurationException {
        UnionAttributes attributes = new UnionAttributes();
        for (int i = 0; i < forClass.getDeclaredFields().length; i++) {
            CorbaUnionElement note = forClass.getDeclaredFields()[i].getAnnotation(CorbaUnionElement.class);
            if (note != null) {
                if (note.type().equals(CorbaUnionElementType.discriminator)) {
                    attributes.setDiscriminatorName(forClass.getDeclaredFields()[i].getName());
                } else if (note.type().equals(CorbaUnionElementType.defaultOption)) {
                    attributes.setDefaultOptionName(forClass.getDeclaredFields()[i].getName());
                } else if (note.type().equals(CorbaUnionElementType.option)) {
                    if (attributes.getOptionsMapping().containsKey(note.optionNumber())) {
                        throw new RequestConfigurationException("In " + forClass
                            + ": field \""
                            + forClass.getDeclaredFields()[i].getName()
                            + "\" uses already used option id: "
                            + note.optionNumber());
                    } else {
                        attributes.getOptionsMapping().put(note.optionNumber(),
                                                           forClass.getDeclaredFields()[i].getName());
                    }
                }
            }
        }
View Full Code Here

            return false;
        }
        boolean atLeastOneOption = false;
        boolean discriminatorPresent = false;
        for (int i = 0; i < forClass.getDeclaredFields().length; i++) {
            CorbaUnionElement note = forClass.getDeclaredFields()[i].getAnnotation(CorbaUnionElement.class);
            if (note != null) {
                int fieldMod = forClass.getDeclaredFields()[i].getModifiers();
                if (Modifier.isPrivate(fieldMod) && !Modifier.isFinal(fieldMod) && !Modifier.isStatic(fieldMod)) {
                    if (note.type().equals(CorbaUnionElementType.discriminator)) {
                        if (discriminatorPresent) {
                            throw new RequestConfigurationException(
                                                                    "More than one discriminators declared on: " + forClass);
                        }
                        discriminatorPresent = true;
View Full Code Here

     * @throws RequestConfigurationException
     */
    private static UnionAttributes getUnionAttributes(Class<?> forClass) throws RequestConfigurationException {
        UnionAttributes attributes = new UnionAttributes();
        for (int i = 0; i < forClass.getDeclaredFields().length; i++) {
            CorbaUnionElement note = forClass.getDeclaredFields()[i].getAnnotation(CorbaUnionElement.class);
            if (note != null) {
                if (note.type().equals(CorbaUnionElementType.discriminator)) {
                    attributes.setDiscriminatorName(forClass.getDeclaredFields()[i].getName());
                } else if (note.type().equals(CorbaUnionElementType.defaultOption)) {
                    attributes.setDefaultOptionName(forClass.getDeclaredFields()[i].getName());
                } else if (note.type().equals(CorbaUnionElementType.option)) {
                    if (attributes.getOptionsMapping().containsKey(note.optionNumber())) {
                        throw new RequestConfigurationException("In " + forClass
                            + ": field \""
                            + forClass.getDeclaredFields()[i].getName()
                            + "\" uses already used option id: "
                            + note.optionNumber());
                    } else {
                        attributes.getOptionsMapping().put(note.optionNumber(),
                                                           forClass.getDeclaredFields()[i].getName());
                    }
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.binding.corba.meta.CorbaUnionElement

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.