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

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


               setMapEntryValue(mapEntryMetaData, parent, owner);
            }
         }

         // the wildcard this element is a content of
         WildcardBinding wildcard = null;
         if(parentTerm != null && !parentTerm.isModelGroup())
         {
            ElementBinding parentElement = (ElementBinding)parentTerm;
            TypeBinding parentType = parentElement.getType();
            wildcard = parentType.getWildcard();
            // there should be a better way of checking this
            if(wildcard != null && parentType.getElement(qName) != null)
            {
               wildcard = null;
            }
         }

         if(tryPut(owner, o, qName, term, trace))
         {
         }
         else if(tryAdd(owner, o, qName, term, wildcard, trace))
         {
         }
         else if (owner instanceof GenericValueContainer)
         {
            if (trace)
            {
               log.trace("setParent " + qName + " addChild");
            }
            ((GenericValueContainer) owner).addChild(qName, o);
         }
         else if (owner instanceof Collection)
         {
            if (trace)
            {
               log.trace("setParent " + qName + " collection.add()");
            }
            ((Collection<Object>) owner).add(o);
         }
         else
         {
            PropertyMetaData propertyMetaData = wildcard == null ? null : wildcard.getPropertyMetaData();
            if (propertyMetaData == null)
            {
               propertyMetaData = term.getPropertyMetaData();
            }
View Full Code Here


      assertTrue(term instanceof ArraySequenceBinding);
      term = assertSingleSequence(term);
      assertTrue(term instanceof SequenceBinding);
      term = assertSingleSequence(term);
      assertTrue(term instanceof WildcardBinding);
      WildcardBinding wildcardBinding = type.getWildcard();
      assertNotNull(wildcardBinding);
      assertTrue(term == wildcardBinding);
      assertTrue(wildcardBinding.isProcessContentsLax());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
      assertNotNull(particleHandler);
      assertTrue(particleHandler instanceof PropertyWildcardHandler);
   }
View Full Code Here

      assertNotNull(term);
      term = assertSingleSequence(term);
      assertTrue(term instanceof SequenceBinding);
      term = assertSingleSequence(term);
      assertTrue(term instanceof WildcardBinding);
      WildcardBinding wildcardBinding = type.getWildcard();
      assertNotNull(wildcardBinding);
      assertTrue(term == wildcardBinding);
      assertTrue(wildcardBinding.isProcessContentsLax());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
      assertNotNull(particleHandler);
      assertTrue(particleHandler instanceof CollectionPropertyWildcardHandler);
   }
View Full Code Here

      assertEquals(1, particles.size());
      particle = particles.iterator().next();
      assertWildcardTerm(element.getType(), particle, (short) 2);

      assertWildcardTerm(type, wp, (short) 3);
      WildcardBinding wildcardBinding = type.getWildcard();
      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
      assertNotNull(particleHandler);
      assertTrue(particleHandler instanceof PropertyWildcardHandler);
   }
View Full Code Here

      assertTrue(particle.getTerm().isWildcard());
      assertEquals(0, particle.getMinOccurs());
      assertEquals(1, particle.getMaxOccurs());
      assertFalse(particle.getMaxOccursUnbounded());

      WildcardBinding wildcardBinding = type.getWildcard();
      assertNotNull(wildcardBinding);
      assertTrue(term == wildcardBinding);
      assertEquals(pc, wildcardBinding.getProcessContents());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
   }
View Full Code Here

      assertTrue(term instanceof ArraySequenceBinding);
      term = assertSingleSequence(term);
      assertTrue(term instanceof SequenceBinding);
      term = assertSingleSequence(term);
      assertTrue(term instanceof WildcardBinding);
      WildcardBinding wildcardBinding = type.getWildcard();
      assertNotNull(wildcardBinding);
      assertTrue(term == wildcardBinding);
      assertTrue(wildcardBinding.isProcessContentsStrict());
      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
      assertNotNull(particleHandler);
      assertTrue(particleHandler instanceof PropertyWildcardHandler);
   }
View Full Code Here

      // bind
      SchemaBinding schema = XsdBinder.bind(new StringReader(XSD), null);

      // get bound components
      TypeBinding type = schema.getType(new QName("http://org.jboss.ws/jbws434/types", "ArrayOfAny"));
      WildcardBinding wildcard = type.getWildcard();
      ElementBinding e = schema.getElement(new QName("http://org.jboss.ws/jbws434/types", "e"));

      // adjust binding
      ParticleHandler unresolvedElementHandler;
      CharactersHandler unresolvedCharactersHandler;
      if(genericElement)
      {
         unresolvedElementHandler = new GenericElementHandler();
         unresolvedCharactersHandler = new GenericCharactersHandler();
      }
      else
      {
         unresolvedElementHandler = DomParticleHandler.INSTANCE;
         unresolvedCharactersHandler = DomCharactersHandler.INSTANCE;
      }

      wildcard.setUnresolvedElementHandler(unresolvedElementHandler);
      wildcard.setUnresolvedCharactersHandler(unresolvedCharactersHandler);
      PropertyMetaData property = new PropertyMetaData();
      property.setName("_any");
      wildcard.setPropertyMetaData(property);

      ClassMetaData clsBinding = new ClassMetaData();
      clsBinding.setImpl(ArrayOfAny.class.getName());
      e.setClassMetaData(clsBinding);
View Full Code Here

      assertNotNull(particle);
      TermBinding term = particle.getTerm();
      assertNotNull(term);
      term = assertSingleSequence(term);
      assertTrue(term instanceof WildcardBinding);
      WildcardBinding wildcardBinding = type.getWildcard();
      assertNotNull(wildcardBinding);
      assertTrue(term == wildcardBinding);
      assertTrue(wildcardBinding.isProcessContentsLax());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
      assertNotNull(particleHandler);
      assertTrue(particleHandler instanceof PropertyWildcardHandler);
   }
View Full Code Here

      assertNotNull(particle);
      TermBinding term = particle.getTerm();
      assertNotNull(term);
      term = assertSingleSequence(term);
      assertTrue(term instanceof WildcardBinding);
      WildcardBinding wildcardBinding = type.getWildcard();
      assertNotNull(wildcardBinding);
      assertTrue(term == wildcardBinding);
      assertTrue(wildcardBinding.isProcessContentsStrict());
      ParticleHandler particleHandler = wildcardBinding.getWildcardHandler();
      assertNotNull(particleHandler);
      assertTrue(particleHandler instanceof PropertyWildcardHandler);
   }
View Full Code Here

      particle = particles.iterator().next();
      term = particle.getTerm();
     
      assertTrue(term instanceof WildcardBinding);
      type = element.getType();
      WildcardBinding wildcardBinding = type.getWildcard();
      assertNotNull(wildcardBinding);
      assertTrue(term == wildcardBinding);
      assertTrue(wildcardBinding.isProcessContentsSkip());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedCharactersHandler());
      assertTrue(DOMHandler.INSTANCE == wildcardBinding.getUnresolvedElementHandler());
   }
View Full Code Here

TOP

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

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.