Package org.jboss.metatype.api.types

Examples of org.jboss.metatype.api.types.CollectionMetaType


         {
            TypeInfo typeInfo = propertyInfo.getType();
            if(typeInfo.isArray())
               metaType = new ArrayMetaType(1, AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
            else if (typeInfo.isCollection())
               metaType = new CollectionMetaType(typeInfo.getName(), AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
            else
               metaType = AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE;
         }
         else
         {
View Full Code Here


               {
                  TypeInfo typeInfo = propertyInfo.getType();
                  if(typeInfo.isArray())
                     metaType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
                  else if (typeInfo.isCollection())
                     metaType = new CollectionMetaType(typeInfo.getName(), MANAGED_OBJECT_META_TYPE);
                  else
                     metaType = MANAGED_OBJECT_META_TYPE;
               }
               else
               {
View Full Code Here

            return moArrayValue;
         }
      }
      else if (propertyType.isCollection())
      {
         CollectionMetaType collectionType = CollectionMetaType.class.cast(propertyType);
         if (MANAGED_OBJECT_META_TYPE == collectionType.getElementType())
         {
            Collection<?> cvalue = getAsCollection(value);
            List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
            for(Object element : cvalue)
            {
               ManagedObject mo = initManagedObject((Serializable) element, null, null);
               tmp.add(new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo));
            }
            GenericValueSupport[] mos = new GenericValueSupport[tmp.size()];
            CollectionMetaType moType = new CollectionMetaType(propertyType.getClassName(), MANAGED_OBJECT_META_TYPE);
            return new CollectionValueSupport(moType, tmp.toArray(mos));
         }
      }

      return metaValueFactory.create(value, propertyInfo.getType());
View Full Code Here

/* 273 */     TypeInfo[] types = typeInfo.getActualTypeArguments();
/* 274 */     if (types != null) {
/* 275 */       elementType = types[0];
/*     */     }
/* 277 */     MetaType elementMetaType = resolve(elementType);
/* 278 */     return new CollectionMetaType(typeInfo.getName(), elementMetaType);
/*     */   }
View Full Code Here

/* 341 */             processGenericValue((GenericValue)avalue.getValue(n), md);
/*     */         }
/*     */       }
/* 344 */       else if (propType.isCollection())
/*     */       {
/* 346 */         CollectionMetaType amt = (CollectionMetaType)propType;
/* 347 */         MetaType etype = amt.getElementType();
/* 348 */         if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
/*     */         {
/* 350 */           CollectionValue avalue = (CollectionValue)prop.getValue();
/* 351 */           if (avalue != null)
/*     */           {
View Full Code Here

/*     */             }
/*     */             else
/*     */             {
/*     */               MetaType metaType;
/* 423 */               if (typeInfo.isCollection())
/* 424 */                 metaType = new CollectionMetaType(typeInfo.getName(), MANAGED_OBJECT_META_TYPE);
/*     */               else
/* 426 */                 metaType = MANAGED_OBJECT_META_TYPE;
/*     */             }
/*     */           }
/*     */           else {
View Full Code Here

/* 737 */         return moArrayValue;
/*     */       }
/*     */     }
/* 740 */     else if (propertyType.isCollection())
/*     */     {
/* 742 */       CollectionMetaType collectionType = (CollectionMetaType)CollectionMetaType.class.cast(propertyType);
/* 743 */       if (MANAGED_OBJECT_META_TYPE == collectionType.getElementType())
/*     */       {
/* 745 */         Collection cvalue = getAsCollection(value);
/* 746 */         List tmp = new ArrayList();
/* 747 */         for (Iterator i$ = cvalue.iterator(); i$.hasNext(); ) { Object element = i$.next();
/*     */
/* 749 */           ManagedObject mo = initManagedObject((Serializable)element, null, null);
/* 750 */           tmp.add(new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo));
/*     */         }
/* 752 */         GenericValueSupport[] mos = new GenericValueSupport[tmp.size()];
/* 753 */         CollectionMetaType moType = new CollectionMetaType(propertyType.getClassName(), MANAGED_OBJECT_META_TYPE);
/* 754 */         return new CollectionValueSupport(moType, (MetaValue[])tmp.toArray(mos));
/*     */       }
/*     */     }
/*     */
/* 758 */     return this.metaValueFactory.create(value, propertyInfo.getType());
View Full Code Here

      TypeInfo[] types = typeInfo.getActualTypeArguments();
      if (types != null)
         elementType = types[0];
     
      MetaType elementMetaType = resolve(elementType);
      return new CollectionMetaType(typeInfo.getName(), elementMetaType);
   }
View Full Code Here

                  {
                     TypeInfo typeInfo = propertyInfo.getType();
                     if(typeInfo.isArray())
                        metaType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
                     else if (typeInfo.isCollection())
                        metaType = new CollectionMetaType(typeInfo.getName(), MANAGED_OBJECT_META_TYPE);
                     else
                        metaType = MANAGED_OBJECT_META_TYPE;
                  }
                  else
                  {
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.types.CollectionMetaType

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.