Package org.jboss.xb.binding.group

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


      {
         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 + localInterceptorsTotal - i)).o,
                  endName, type, nsRegistry, dataContent
               );
            }

            for(int i = localInterceptorsTotal - 1; i >= 0; --i)
            {
               ElementInterceptor interceptor = (ElementInterceptor)localInterceptors.get(i);
               interceptor.characters(((StackItem)stack.peek(localInterceptorsTotal - 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

/*    */     {
/* 68 */       ((GenericValueContainer)owner).addChild(attrName, value);
/*    */     }
/* 70 */     else if ((owner instanceof ValueList))
/*    */     {
/* 72 */       ValueList valueList = (ValueList)owner;
/* 73 */       valueList.getInitializer().addAttributeValue(attrName, binding, valueList, value);
/*    */     }
/*    */     else
/*    */     {
/* 77 */       String property = null;
/* 78 */       PropertyMetaData propertyMetaData = binding.getPropertyMetaData();
View Full Code Here

/*      */   {
/*  803 */     if (this.trace) {
/*  804 */       log.trace(" end repeatable (" + this.stack.size() + "): " + particle.getTerm());
/*      */     }
/*  806 */     StackItem item = this.stack.peek();
/*  807 */     ValueList valueList = item.repeatableParticleValue;
/*  808 */     if (valueList != null)
/*      */     {
/*  810 */       item.repeatableParticleValue = null;
/*  811 */       if (valueList.size() == 0)
/*      */       {
/*  813 */         return;
/*      */       }
/*      */
/*  816 */       if (particle.getTerm().isWildcard())
/*      */       {
/*  818 */         ParticleHandler handler = null;
/*      */
/*  828 */         QName qName = valueList.getValue(0).qName;
/*  829 */         Collection col = new ArrayList();
/*  830 */         for (int i = 0; i < valueList.size(); i++)
/*      */         {
/*  832 */           ValueList.NonRequiredValue value = valueList.getValue(i);
/*  833 */           col.add(value.value);
/*      */
/*  835 */           if (handler == value.handler)
/*      */             continue;
/*  837 */           if ((handler == null) && (i == 0))
/*      */           {
/*  839 */             handler = (ParticleHandler)value.handler;
/*      */           }
/*      */           else
/*      */           {
/*  843 */             throw new JBossXBRuntimeException("Handlers in the list are supposed to be the same.");
/*      */           }
/*      */
/*      */         }
/*      */
/*  848 */         StackItem parentItem = this.stack.peek(1);
/*  849 */         handler.setParent(parentItem.o, col, qName, particle, parentItem.particle);
/*      */       }
/*      */       else
/*      */       {
/*  853 */         valueList.getHandler().newInstance(particle, valueList);
/*      */       }
/*      */     }
/*      */   }
View Full Code Here

/*      */     {
/*  871 */       if (this.trace)
/*      */       {
/*  873 */         log.trace("endParticle " + modelGroupParticle.getTerm() + " valueList");
/*      */       }
/*  875 */       ValueList valueList = (ValueList)item.o;
/*  876 */       o = valueList.getHandler().newInstance(modelGroupParticle, valueList);
/*      */     }
/*      */     else
/*      */     {
/*  880 */       o = handler.endParticle(item.o, qName, modelGroupParticle);
/*      */     }
View Full Code Here

/* 1068 */               this.ctx.clear();
/*      */             }
/*      */
/* 1071 */             if ((o instanceof ValueList))
/*      */             {
/* 1073 */               ValueList valueList = (ValueList)o;
/* 1074 */               if (type.isSimple())
/*      */               {
/* 1076 */                 valueList.getInitializer().addTermValue(endName, particle, charHandler, valueList, unmarshalled, null);
/*      */               }
/*      */               else
/*      */               {
/* 1086 */                 valueList.getInitializer().addTextValue(endName, particle, charHandler, valueList, unmarshalled);
/*      */               }
/*      */
/*      */             }
/*      */             else
/*      */             {
/* 1096 */               charHandler.setValue(endName, element, o, unmarshalled);
/*      */             }
/*      */           }
/*      */         }
/*      */
/* 1101 */         for (int i = interceptorsTotal - 1; i >= 0; i--)
/*      */         {
/* 1103 */           ElementInterceptor interceptor = (ElementInterceptor)interceptors.get(i);
/* 1104 */           interceptor.characters(this.stack.peek(interceptorsTotal + localInterceptorsTotal - i).o, endName, type, this.nsRegistry, dataContent);
/*      */         }
/*      */
/* 1109 */         for (int i = localInterceptorsTotal - 1; i >= 0; i--)
/*      */         {
/* 1111 */           ElementInterceptor interceptor = (ElementInterceptor)localInterceptors.get(i);
/* 1112 */           interceptor.characters(this.stack.peek(localInterceptorsTotal - i).o, endName, type, this.nsRegistry, dataContent);
/*      */         }
/*      */
/*      */       }
/*      */
/*      */     }
/*      */     else
/*      */     {
/* 1120 */       o = null;
/*      */     }
/*      */
/* 1127 */     StackItem parentItem = this.stack.size() == 1 ? null : this.stack.peek(1);
/* 1128 */     Object parent = parentItem == null ? null : parentItem.o;
/* 1129 */     ParticleHandler handler = this.stack.peek().handler;
/*      */
/* 1131 */     if (((o instanceof ValueList)) && (!particle.getTerm().isSkip()))
/*      */     {
/* 1133 */       if (this.trace)
/*      */       {
/* 1135 */         log.trace("endParticle " + endName + " valueList");
/*      */       }
/* 1137 */       ValueList valueList = (ValueList)o;
/* 1138 */       o = valueList.getHandler().newInstance(particle, valueList);
/*      */     }
/*      */     else
/*      */     {
/* 1142 */       o = handler.endParticle(o, endName, particle);
/*      */     }
View Full Code Here

/*      */     {
/* 1279 */       if (parent == o)
/*      */       {
/* 1281 */         return;
/*      */       }
/* 1283 */       ValueList valueList = (ValueList)parent;
/* 1284 */       valueList.getInitializer().addTermValue(endName, particle, handler, valueList, o, parentParticle);
/*      */     }
/*      */     else
/*      */     {
/* 1288 */       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

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.