Package org.jboss.xb.binding.group

Examples of org.jboss.xb.binding.group.ValueList


   private void endRepeatableParticle(ParticleBinding particle)
   {
      //System.out.println(" end repeatable (" + stack.size() + "): " + particle.getTerm());

      StackItem item = stack.peek();
      ValueList valueList = item.repeatableParticleValue;
      if(valueList != null)
      {
         item.repeatableParticleValue = null;
         if(valueList.size() == 0)
         {
            return;
         }
           
         if(particle.getTerm().isWildcard())
         {
            ParticleHandler handler = ((WildcardBinding)particle.getTerm()).getWildcardHandler();
            if(handler == null)
            {
               handler = defParticleHandler;
            }

            // that's not good. some elements can be handled as "unresolved" and some as "resolved"
            QName qName = valueList.getValue(0).qName;
            Collection col = new ArrayList();
            for(int i = 0; i < valueList.size(); ++i)
            {
               col.add(valueList.getValue(i).value);
            }
            StackItem parentItem = stack.peek(1);
            handler.setParent(parentItem.o, col, qName, particle, parentItem.particle);
         }
         else
         {
            valueList.getHandler().newInstance(particle, valueList);
         }
      }
   }
View Full Code Here


      {
         if(trace)
         {
            log.trace("endParticle " + modelGroupParticle.getTerm() + " valueList");
         }
         ValueList valueList = (ValueList)item.o;
         o = valueList.getHandler().newInstance(modelGroupParticle, valueList);
      }
      else
      {
         o = handler.endParticle(item.o, qName, modelGroupParticle);
      }
View Full Code Here

                     ctx.clear();
                  }

                  if(o instanceof ValueList)
                  {
                     ValueList valueList = (ValueList)o;
                     if(type.isSimple())
                     {
                        valueList.getInitializer().addTermValue(endName,
                           particle,
                           charHandler,
                           valueList,
                           unmarshalled,
                           null
                        );
                     }
                     else
                     {
                        valueList.getInitializer().addTextValue(endName,
                           particle,
                           charHandler,
                           valueList,
                           unmarshalled
                        );
                     }
                  }
                  else
                  {
                     charHandler.setValue(endName, element, o, unmarshalled);
                  }
               }
            }

            for(int i = interceptorsTotal - 1; i >= 0; --i)
            {
               ElementInterceptor interceptor = (ElementInterceptor)interceptors.get(i);
               interceptor.characters(((StackItem)stack.peek(interceptorsTotal - i)).o,
                  endName, type, nsRegistry, dataContent
               );
            }
         }
      }
      else
      {
         o = null;
      }

      //
      // endElement
      //

      StackItem parentItem = stack.size() == 1 ? null : stack.peek(1);
      Object parent = parentItem == null ? null : parentItem.o;
      ParticleHandler handler = stack.peek().handler;
     
      if(o instanceof ValueList && !particle.getTerm().isSkip())
      {
         if(trace)
         {
            log.trace("endParticle " + endName + " valueList");
         }
         ValueList valueList = (ValueList)o;
         o = valueList.getHandler().newInstance(particle, valueList);
      }
      else
      {
         o = handler.endParticle(o, endName, particle);
      }
View Full Code Here

      {
         if(parent == o)
         {           
            return;
         }
         ValueList valueList = (ValueList)parent;
         valueList.getInitializer().addTermValue(endName, particle, handler, valueList, o, parentParticle);
      }
      else
      {
         handler.setParent(parent, o, endName, particle, parentParticle);
      }
View Full Code Here

   private void endRepeatableParticle(ParticleBinding particle)
   {
      //System.out.println(" end repeatable (" + stack.size() + "): " + particle.getTerm());

      StackItem item = stack.peek();
      ValueList valueList = item.repeatableParticleValue;
      if(valueList != null)
      {
         item.repeatableParticleValue = null;
         if(valueList.size() == 0)
         {
            return;
         }
           
         if(particle.getTerm().isWildcard())
         {
            ParticleHandler handler = ((WildcardBinding)particle.getTerm()).getWildcardHandler();
            if(handler == null)
            {
               handler = defParticleHandler;
            }

            // that's not good. some elements can be handled as "unresolved" and some as "resolved"
            QName qName = valueList.getValue(0).qName;
            Collection col = new ArrayList();
            for(int i = 0; i < valueList.size(); ++i)
            {
               col.add(valueList.getValue(i).value);
            }
            StackItem parentItem = stack.peek(1);
            handler.setParent(parentItem.o, col, qName, particle, parentItem.particle);
         }
         else
         {
            valueList.getHandler().newInstance(particle, valueList);
         }
      }
   }
View Full Code Here

      {
         if(trace)
         {
            log.trace("endParticle " + modelGroupParticle.getTerm() + " valueList");
         }
         ValueList valueList = (ValueList)item.o;
         o = valueList.getHandler().newInstance(modelGroupParticle, valueList);
      }
      else
      {
         o = handler.endParticle(item.o, qName, modelGroupParticle);
      }
View Full Code Here

                     ctx.clear();
                  }

                  if(o instanceof ValueList)
                  {
                     ValueList valueList = (ValueList)o;
                     if(type.isSimple())
                     {
                        valueList.getInitializer().addTermValue(endName,
                           particle,
                           charHandler,
                           valueList,
                           unmarshalled,
                           null
                        );
                     }
                     else
                     {
                        valueList.getInitializer().addTextValue(endName,
                           particle,
                           charHandler,
                           valueList,
                           unmarshalled
                        );
                     }
                  }
                  else
                  {
                     charHandler.setValue(endName, element, o, unmarshalled);
                  }
               }
            }

            for(int i = interceptorsTotal - 1; i >= 0; --i)
            {
               ElementInterceptor interceptor = (ElementInterceptor)interceptors.get(i);
               interceptor.characters(((StackItem)stack.peek(interceptorsTotal - i)).o,
                  endName, type, nsRegistry, dataContent
               );
            }
         }
      }
      else
      {
         o = null;
      }

      //
      // endElement
      //

      StackItem parentItem = stack.size() == 1 ? null : stack.peek(1);
      Object parent = parentItem == null ? null : parentItem.o;
      ParticleHandler handler = stack.peek().handler;
     
      if(o instanceof ValueList && !particle.getTerm().isSkip())
      {
         if(trace)
         {
            log.trace("endParticle " + endName + " valueList");
         }
         ValueList valueList = (ValueList)o;
         o = valueList.getHandler().newInstance(particle, valueList);
      }
      else
      {
         o = handler.endParticle(o, endName, particle);
      }
View Full Code Here

      {
         if(parent == o)
         {           
            return;
         }
         ValueList valueList = (ValueList)parent;
         valueList.getInitializer().addTermValue(endName, particle, handler, valueList, o, parentParticle);
      }
      else
      {
         handler.setParent(parent, o, endName, particle, parentParticle);
      }
View Full Code Here

   private void endRepeatableParticle(ParticleBinding particle)
   {
      //System.out.println(" end repeatable (" + stack.size() + "): " + particle.getTerm());

      StackItem item = stack.peek();
      ValueList valueList = item.repeatableParticleValue;
      if(valueList != null)
      {
         item.repeatableParticleValue = null;
         if(valueList.size() == 0)
         {
            return;
         }
           
         if(particle.getTerm().isWildcard())
         {
            ParticleHandler handler = null;
/*
            handler = ((WildcardBinding) particle.getTerm()).getWildcardHandler();
            if (handler == null)
            {
               handler = defParticleHandler;
            }
*/
           
            // that's not good. some elements can be handled as "unresolved" and some as "resolved"
            QName qName = valueList.getValue(0).qName;
            Collection col = new ArrayList();
            for(int i = 0; i < valueList.size(); ++i)
            {
               NonRequiredValue value = valueList.getValue(i);
               col.add(value.value);

               if(handler != value.handler)
               {
                  if(handler == null && i == 0)
                  {
                     handler = (ParticleHandler) value.handler;
                  }
                  else
                  {
                     throw new JBossXBRuntimeException("Handlers in the list are supposed to be the same.");
                  }
               }
            }

            StackItem parentItem = stack.peek(1);
            handler.setParent(parentItem.o, col, qName, particle, parentItem.particle);
         }
         else
         {
            valueList.getHandler().newInstance(particle, valueList);
         }
      }
   }
View Full Code Here

      {
         if(trace)
         {
            log.trace("endParticle " + modelGroupParticle.getTerm() + " valueList");
         }
         ValueList valueList = (ValueList)item.o;
         o = valueList.getHandler().newInstance(modelGroupParticle, valueList);
      }
      else
      {
         o = handler.endParticle(item.o, qName, modelGroupParticle);
      }
View Full Code Here

TOP

Related Classes of org.jboss.xb.binding.group.ValueList

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.