Package org.jboss.xb.binding.sunday.unmarshalling

Examples of org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding


   }

   public void testGlobalGroup() throws Exception
   {
      SchemaBinding schema = bind("GlobalGroup.xsd");
      ModelGroupBinding group = schema.getGroup(new QName(NS, "global1"));
      assertNotNull(group);
     
      ElementBinding element = schema.getElement(new QName(NS, "parent"));
      assertNotNull(element);
      TypeBinding type = element.getType();
View Full Code Here


   }

   public void testGlobalGroupForwardsAndBackwardsRefs() throws Exception
   {
      SchemaBinding schema = bind("GlobalGroup.xsd");
      ModelGroupBinding group2 = schema.getGroup(new QName(NS, "global2"));
      assertNotNull(group2);
      ModelGroupBinding group3 = schema.getGroup(new QName(NS, "global3"));
      assertNotNull(group3);
      ModelGroupBinding group4 = schema.getGroup(new QName(NS, "global4"));
      assertNotNull(group4);
     
      // Forwards
      Collection<ParticleBinding> particles = group2.getParticles();
      assertNotNull(particles);
      assertEquals(1, particles.size());
      ParticleBinding particle = particles.iterator().next();
      TermBinding term = particle.getTerm();
      assertTrue(term == group3);
     
      // Backwards
      particles = group4.getParticles();
      assertNotNull(particles);
      assertEquals(1, particles.size());
      particle = particles.iterator().next();
      term = particle.getTerm();
      assertTrue(term == group3);
View Full Code Here

      assertNotNull(element);
      element.setClassMetaData(classMetaData);

      classMetaData = new ClassMetaData();
      classMetaData.setImpl(Global1.class.getName());
      ModelGroupBinding group = schema.getGroup(new QName(NS, "global1"));
      assertNotNull(group);
      group.setClassMetaData(classMetaData);
      group.setSkip(Boolean.FALSE);

      // TODO should be able to determine this from the global group name!
      PropertyMetaData prop = new PropertyMetaData();
      prop.setName("global1");
      group.setPropertyMetaData(prop);
     
      Parent parent = (Parent) unmarshal("GlobalGroup.xml", schema, Parent.class);
      assertNotNull(parent.global1);
      assertEquals(2, parent.global1.child.size());
     
View Full Code Here

      {
         TypeBinding type = ((ElementBinding)term).getType();
         if(type.getAttributes().isEmpty())
         {
            ParticleBinding typeParticle = type.getParticle();
            ModelGroupBinding modelGroup = (ModelGroupBinding)(typeParticle == null ? null : typeParticle.getTerm());
            arrayItem = modelGroup == null ? null : modelGroup.getArrayItem();

            // todo refactor later (move it to modelGroup.getArrayItem()?)
            if(arrayItem != null &&
               (arrayItem.isSkip() ||
               arrayItem.getMapEntryMetaData() != null ||
View Full Code Here

      {
         ElementBinding arrayItem = null;
         if(!type.isSimple() && type.getAttributes().isEmpty())
         {
            ParticleBinding typeParticle = type.getParticle();
            ModelGroupBinding modelGroup = (ModelGroupBinding)(typeParticle == null ? null : typeParticle.getTerm());
            arrayItem = modelGroup == null ? null : modelGroup.getArrayItem();
         }

         if(arrayItem != null)
         {
            cls = classForElement(arrayItem, parentClass);
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.sunday.unmarshalling.ModelGroupBinding

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.