Package org.jboss.metatype.api.types

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


         MetaType metaType;
         if (managed)
         {
            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;
         }
View Full Code Here


               MetaType metaType;
               if (managed)
               {
                  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;
               }
View Full Code Here

         ManagedObject mo = initManagedObject((Serializable) value, moName, moNameType);
         return new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo);
      }
      else if (propertyType.isArray())
      {
         ArrayMetaType arrayType = ArrayMetaType.class.cast(propertyType);
         if (MANAGED_OBJECT_META_TYPE == arrayType.getElementType())
         {
            Collection<?> cvalue = getAsCollection(value);
            // todo - AJ: changed some generics by best guess
            ArrayMetaType moType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
            ArrayValueSupport moArrayValue = new ArrayValueSupport(moType);
            List<GenericValueSupport> tmp = new ArrayList<GenericValueSupport>();
            for(Object element : cvalue)
            {
               ManagedObject mo = initManagedObject((Serializable) element, null, null);
View Full Code Here

/*     */     {
/* 255 */       dimension++;
/* 256 */       componentType = ((ArrayInfo)componentType).getComponentType();
/*     */     }
/* 258 */     MetaType componentMetaType = resolve(componentType);
/* 259 */     return new ArrayMetaType(dimension, componentMetaType, componentType.isPrimitive());
/*     */   }
View Full Code Here

/*     */       {
/* 330 */         processGenericValue((GenericValue)prop.getValue(), md);
/*     */       }
/* 332 */       else if (propType.isArray())
/*     */       {
/* 334 */         ArrayMetaType amt = (ArrayMetaType)propType;
/* 335 */         MetaType etype = amt.getElementType();
/* 336 */         if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
/*     */         {
/* 338 */           ArrayValue avalue = (ArrayValue)prop.getValue();
/* 339 */           int length = avalue != null ? avalue.getLength() : 0;
/* 340 */           for (int n = 0; n < length; n++)
/* 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

/* 418 */           if (managed)
/*     */           {
/* 420 */             TypeInfo typeInfo = propertyInfo.getType();
/*     */             MetaType metaType;
/* 421 */             if (typeInfo.isArray()) {
/* 422 */               metaType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
/*     */             }
/*     */             else
/*     */             {
/*     */               MetaType metaType;
/* 423 */               if (typeInfo.isCollection())
View Full Code Here

/* 717 */       ManagedObject mo = initManagedObject((Serializable)value, moName, moNameType);
/* 718 */       return new GenericValueSupport(MANAGED_OBJECT_META_TYPE, mo);
/*     */     }
/* 720 */     if (propertyType.isArray())
/*     */     {
/* 722 */       ArrayMetaType arrayType = (ArrayMetaType)ArrayMetaType.class.cast(propertyType);
/* 723 */       if (MANAGED_OBJECT_META_TYPE == arrayType.getElementType())
/*     */       {
/* 725 */         Collection cvalue = getAsCollection(value);
/*     */
/* 727 */         ArrayMetaType moType = new ArrayMetaType(1, MANAGED_OBJECT_META_TYPE);
/* 728 */         ArrayValueSupport moArrayValue = new ArrayValueSupport(moType);
/* 729 */         List tmp = new ArrayList();
/* 730 */         for (Iterator i$ = cvalue.iterator(); i$.hasNext(); ) { Object element = i$.next();
/*     */
/* 732 */           ManagedObject mo = initManagedObject((Serializable)element, null, null);
View Full Code Here

/*      */     try
/*      */     {
/*  875 */       TypeInfoFactory tif = configuration.getTypeInfoFactory();
/*  876 */       if (metaType.isArray())
/*      */       {
/*  878 */         ArrayMetaType arrayMetaType = (ArrayMetaType)metaType;
/*  879 */         MetaType elementMetaType = arrayMetaType.getElementType();
/*  880 */         String elementTypeName = elementMetaType.getTypeName();
/*  881 */         if (arrayMetaType.isPrimitiveArray())
/*  882 */           elementTypeName = ArrayMetaType.getPrimitiveName(elementTypeName);
/*  883 */         TypeInfo elementTypeInfo = tif.getTypeInfo(elementTypeName, cl);
/*  884 */         int dimension = arrayMetaType.getDimension() - 1;
/*  885 */         TypeInfo typeInfo = elementTypeInfo.getArrayType();
/*  886 */         while (dimension > 0)
/*      */         {
/*  888 */           typeInfo = typeInfo.getArrayType();
/*  889 */           dimension--;
View Full Code Here

      {
         ++dimension;
         componentType = ((ArrayInfo) componentType).getComponentType();
      }
      MetaType componentMetaType = resolve(componentType);
      return new ArrayMetaType(dimension, componentMetaType, componentType.isPrimitive());
   }
View Full Code Here

      try
      {
         TypeInfoFactory tif = configuration.getTypeInfoFactory();
         if (metaType.isArray())
         {
            ArrayMetaType arrayMetaType = (ArrayMetaType)metaType;
            MetaType elementMetaType = arrayMetaType.getElementType();
            String elementTypeName = elementMetaType.getTypeName();
            if (arrayMetaType.isPrimitiveArray())
               elementTypeName = ArrayMetaType.getPrimitiveName(elementTypeName);
            TypeInfo elementTypeInfo = tif.getTypeInfo(elementTypeName, cl);
            int dimension = arrayMetaType.getDimension() - 1; // minus 1, since we already use first in next line
            TypeInfo typeInfo = elementTypeInfo.getArrayType();
            while(dimension > 0)
            {
               typeInfo = typeInfo.getArrayType();
               dimension--;
View Full Code Here

TOP

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

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.