Package org.jboss.xb.spi

Examples of org.jboss.xb.spi.BeanAdapter


   @Override
   public void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName)
   {
      try
      {
         BeanAdapter beanAdapter = (BeanAdapter) parent;
         beanAdapter.set(propertyInfo, child);
      }
      catch (Throwable t)
      {
         throw new RuntimeException("QName " + qName + " error setting property " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent));
      }
View Full Code Here


         if (propertyType.isArray())
         {
            ArrayWrapper wrapper = (ArrayWrapper) child;
            child = wrapper.getArray(propertyType);
         }
         BeanAdapter beanAdapter = (BeanAdapter) parent;
         beanAdapter.set(propertyInfo, child);
      }
      catch (Throwable t)
      {
         throw new RuntimeException("QName " + qName + " error setting property " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent), t);
      }
View Full Code Here

   {
      ValueAdapter valueAdapter = binding.getValueAdapter();
      if (valueAdapter != null)
         value = valueAdapter.cast(value, null);
     
      BeanAdapter parent = (BeanAdapter) owner;
      doHandle(parent, value, attrName);
   }
View Full Code Here

   @Override
   @SuppressWarnings("unchecked")
   public void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName)
   {
      BeanAdapter beanAdapter = (BeanAdapter) parent;
     
      Collection<Object> c = null;
      try
      {
         if (propertyInfo.getGetter() != null)
            c = (Collection) beanAdapter.get(propertyInfo);
      }
      catch (Throwable t)
      {
         throw new RuntimeException("QName " + qName + " error getting collection property " + propertyInfo.getName() + " for " + BuilderUtil.toDebugString(parent), t);
      }
     
      // No collection so create one
      if (c == null)
      {
         try
         {
            c = colFactory.createCollection();
         }
         catch (Throwable t)
         {
            throw new RuntimeException("QName " + qName + " error creating collection: " + propertyType.getName(), t);
         }

         try
         {
            beanAdapter.set(propertyInfo, c);
         }
         catch (Throwable t)
         {
            throw new RuntimeException("QName " + qName + " error setting collection property " + propertyInfo.getName() + " for " + BuilderUtil.toDebugString(parent) + " with value " + BuilderUtil.toDebugString(c), t);
         }
View Full Code Here

         wrapper.setChildParticle(particle);
         wrapper.setParentParticle(parentParticle);
         return;
      }

      BeanAdapter beanAdapter;
      if (parent instanceof ArrayWrapper)
         beanAdapter = (BeanAdapter) ((ArrayWrapper) parent).getParent();
      else
         beanAdapter = (BeanAdapter) parent;
      AbstractPropertyHandler propertyHandler = beanAdapter.getPropertyHandler(qName);
      if (propertyHandler == null)
      {
         AbstractPropertyHandler wildcardHandler = beanAdapter.getWildcardHandler();
         if (wildcardHandler != null)
         {
            if (o != null && o instanceof ArrayWrapper)
            {
               ArrayWrapper wrapper = (ArrayWrapper) o;
               wildcardHandler.doHandle(beanAdapter, wrapper, wrapper.getElementName());
               return;
            }
         }
         TermBinding element = term;
         if (element.getSchema().isStrictSchema())
         {
            throw new RuntimeException("QName " + qName + " unknown property parent=" + BuilderUtil.toDebugString(parent) + " child=" + BuilderUtil.toDebugString(o) + " available=" + beanAdapter.getAvailable());
         }
         if (trace)
            log.trace("QName " + qName + " unknown property parent=" + BuilderUtil.toDebugString(parent) + " child=" + BuilderUtil.toDebugString(o));
         return;
      }
View Full Code Here

   public Object endParticle(Object o, QName qName, ParticleBinding particle)
   {
      if (trace)
         log.trace("endElement " + qName + " o=" + BuilderUtil.toDebugString(o));

      BeanAdapter beanAdapter = (BeanAdapter) o;
      return beanAdapter.getValue();
   }
View Full Code Here

/* 77 */       if (this.propertyType.isArray())
/*    */       {
/* 79 */         ArrayWrapper wrapper = (ArrayWrapper)child;
/* 80 */         child = wrapper.getArray(this.propertyType);
/*    */       }
/* 82 */       BeanAdapter beanAdapter = (BeanAdapter)parent;
/* 83 */       beanAdapter.set(this.propertyInfo, child);
/*    */     }
/*    */     catch (Throwable t)
/*    */     {
/* 87 */       throw new RuntimeException("QName " + qName + " error setting property " + this.propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent), t);
/*    */     }
View Full Code Here

/*    */
/*    */   public void handle(PropertyInfo propertyInfo, TypeInfo propertyType, Object parent, Object child, QName qName)
/*    */   {
/*    */     try
/*    */     {
/* 55 */       BeanAdapter beanAdapter = (BeanAdapter)parent;
/* 56 */       beanAdapter.set(propertyInfo, child);
/*    */     }
/*    */     catch (Throwable t)
/*    */     {
/* 60 */       throw new RuntimeException("QName " + qName + " error setting property " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent));
/*    */     }
View Full Code Here

/* 55 */       if (propertyType.isArray())
/*    */       {
/* 57 */         ArrayWrapper wrapper = (ArrayWrapper)child;
/* 58 */         child = wrapper.getArray(propertyType);
/*    */       }
/* 60 */       BeanAdapter beanAdapter = (BeanAdapter)parent;
/* 61 */       beanAdapter.set(propertyInfo, child);
/*    */     }
/*    */     catch (Throwable t)
/*    */     {
/* 65 */       throw new RuntimeException("QName " + qName + " error setting property " + propertyInfo.getName() + " with value " + BuilderUtil.toDebugString(child) + " to " + BuilderUtil.toDebugString(parent), t);
/*    */     }
View Full Code Here

/*     */   {
/* 113 */     ValueAdapter valueAdapter = binding.getValueAdapter();
/* 114 */     if (valueAdapter != null) {
/* 115 */       value = valueAdapter.cast(value, null);
/*     */     }
/* 117 */     BeanAdapter parent = (BeanAdapter)owner;
/* 118 */     doHandle(parent, value, attrName);
/*     */   }
View Full Code Here

TOP

Related Classes of org.jboss.xb.spi.BeanAdapter

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.