Examples of Union


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

        fixedHandler.setValue(fixedValue);
    }

    public void readUnion(CorbaObjectHandler obj) throws CorbaBindingException {
        CorbaUnionHandler unionHandler = (CorbaUnionHandler)obj;
        Union unionType = (Union)unionHandler.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        CorbaObjectHandler discriminator = unionHandler.getDiscriminator();
        if (branches.size() > 0) {
            this.read(discriminator);
            String discLabel = null;
            if (discriminator.getTypeCodeKind().value() == TCKind._tk_enum) {
View Full Code Here

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

        long scale = fixedHandler.getScale();
        stream.write_fixed(fixedHandler.getValue().movePointRight((int)scale));
    }

    public void writeUnion(CorbaObjectHandler obj) throws CorbaBindingException {
        Union unionType = (Union) obj.getType();
        List<Unionbranch> branches = unionType.getUnionbranch();
        if (branches.size() > 0) {
            CorbaObjectHandler discriminator = ((CorbaUnionHandler)obj).getDiscriminator();
            this.write(discriminator);
            CorbaObjectHandler unionValue = ((CorbaUnionHandler)obj).getValue();
            if (unionValue != null) {
View Full Code Here

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

        }
        return tc;
    }
   
    public static TypeCode getUnionTypeCode(ORB orb, Object obj, List<CorbaTypeMap> typeMaps) {
        Union unionType = (Union)obj;
       
        TypeCode discTC = getTypeCode(orb, unionType.getDiscriminator(), typeMaps);
        Map<String, UnionMember> members = new LinkedHashMap<String, UnionMember>();
        List<Unionbranch> branches = unionType.getUnionbranch();
        for (Iterator<Unionbranch> branchIter = branches.iterator(); branchIter.hasNext();) {
            Unionbranch branch = branchIter.next();
            List<CaseType> cases = branch.getCase();
            for (Iterator<CaseType> caseIter = cases.iterator(); caseIter.hasNext();) {
                CaseType cs = caseIter.next();
                UnionMember member = new UnionMember();
                member.name = branch.getName();
                member.type = getTypeCode(orb, branch.getIdltype(), typeMaps);
                member.label = orb.create_any();
               
                // We need to insert the labels in a way that depends on the type of the discriminator. 
                // According to the CORBA specification, the following types are permissable as
                // discriminator types:
                //    * signed & unsigned short
                //    * signed & unsigned long
                //    * signed & unsigned long long
                //    * char
                //    * boolean
                switch (discTC.kind().value()) {
                case TCKind._tk_short:
                    member.label.insert_short(Short.parseShort(cs.getLabel()));
                    break;
                case TCKind._tk_ushort:
                    member.label.insert_ushort(Short.parseShort(cs.getLabel()));
                    break;
                case TCKind._tk_long:
                    member.label.insert_long(Integer.parseInt(cs.getLabel()));
                    break;
                case TCKind._tk_ulong:
                    member.label.insert_ulong(Integer.parseInt(cs.getLabel()));
                    break;
                case TCKind._tk_longlong:
                    member.label.insert_longlong(Long.parseLong(cs.getLabel()));
                    break;
                case TCKind._tk_ulonglong:
                    member.label.insert_ulonglong(Long.parseLong(cs.getLabel()));
                    break;
                case TCKind._tk_char:
                    member.label.insert_char(cs.getLabel().charAt(0));
                    break;
                case TCKind._tk_boolean:
                    member.label.insert_boolean(Boolean.parseBoolean(cs.getLabel()));
                    break;
                default:
                    // TODO: Throw exception since this is an unsupported discriminator type
                }
                // Yoko orb is strict on how the case labels are stored for each member.  So we can't
                // simply insert the labels as strings
                members.put(cs.getLabel(), member);
            }
        }
        return orb.create_union_tc(unionType.getRepositoryID(),
                                   unionType.getName(),
                                   discTC,
                                   (UnionMember[])members.values().toArray(new UnionMember[members.size()]));
    }
View Full Code Here

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

   
    protected MemberType processComplexContentStructChoice(XmlSchemaChoice choice,
                                                     QName schematypeName, QName defaultName)
        throws Exception {
        QName choicename = createQNameTargetNamespace(schematypeName.getLocalPart() + "ChoiceType");
        Union choiceunion = createUnion(choicename, choice,
                                        defaultName, schematypeName);

        String repoId = REPO_STRING + choiceunion.getQName().getLocalPart().replace('.', '/')
            + IDL_VERSION;
        choiceunion.setRepositoryID(repoId);                               
       
        MemberType choicemem = new MemberType();
        choicemem.setName(choiceunion.getQName().getLocalPart() + "_f");
        choicemem.setIdltype(createQNameCorbaNamespace(choiceunion.getQName().getLocalPart()));         
       
        if ((choiceunion != null) && (!isDuplicate(choiceunion))) {
            choiceunion.setQName(null);
            typeMappingType.getStructOrExceptionOrUnion().add(choiceunion);
        }
       
        return choicemem;
    }                   
View Full Code Here

Examples of org.apache.tools.ant.types.resources.Union

    /**
     * Adds resources that will be checked.
     */
    public void add(ResourceCollection rc) {
        if (nestedResources == null) {
            nestedResources = new Union();
        }
        nestedResources.add(rc);
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.Union

    getPath().add(set);
  }

  private synchronized Union getPath() {
    if (path == null) {
      path = new Union();
      path.setProject(getProject());
    }
    return path;
  }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.Union

     * @param rc resource collection to add.
     * @since Ant 1.7
     */
    public void add(ResourceCollection rc) {
        if (resources == null) {
            resources = new Union();
        }
        resources.add(rc);
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.Union

    /**
     * Create a nested sources element.
     * @return a Union instance.
     */
    public synchronized Union createSources() {
        sources = (sources == null) ? new Union() : sources;
        return sources;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.Union

            throw noChildrenAllowed();
        }
        if (control != null) {
            throw oneControl();
        }
        control = new Union();
        return control;
    }
View Full Code Here

Examples of org.apache.tools.ant.types.resources.Union

        checkChildrenAllowed();
        if (c == null) {
            return;
        }
        if (union == null) {
            union = new Union();
            union.setProject(getProject());
            union.setCache(false);
        }
        union.add(c);
        setChecked(false);
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.