Examples of ArrayMetaType


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

               if(metaType == null)
               {
                  if (managed)
                  {
                     if(type.isArray())
                        metaType = new ArrayMetaType(1, AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
                     else if (Collection.class.isAssignableFrom(type))
                        metaType = new CollectionMetaType(type.getName(), AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
                     else
                        metaType = AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE;
                  }
View Full Code Here

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

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

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

      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

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

      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

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

         {
            processGenericValue ((GenericValue)prop.getValue(), md);
         }
         else if (propType.isArray())
         {
            ArrayMetaType amt = (ArrayMetaType) propType;
            MetaType etype = amt.getElementType();
            if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
            {
               ArrayValue avalue = (ArrayValue) prop.getValue();
               int length = avalue != null ? avalue.getLength() : 0;
               for(int n = 0; n < length; n ++)
                  processGenericValue((GenericValue) avalue.getValue(n), md);
            }
         }
         else if (propType.isCollection())
         {
            CollectionMetaType amt = (CollectionMetaType) propType;
            MetaType etype = amt.getElementType();
            if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
            {
               CollectionValue avalue = (CollectionValue) prop.getValue();
               if(avalue != null)
               {
View Full Code Here

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

         {
            processGenericValue ((GenericValue)prop.getValue(), md);
         }
         else if (propType.isArray())
         {
            ArrayMetaType amt = (ArrayMetaType) propType;
            MetaType etype = amt.getElementType();
            if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
            {
               ArrayValue avalue = (ArrayValue) prop.getValue();
               int length = avalue != null ? avalue.getLength() : 0;
               for(int n = 0; n < length; n ++)
                  processGenericValue((GenericValue) avalue.getValue(n), md);
            }
         }
         else if (propType.isCollection())
         {
            CollectionMetaType amt = (CollectionMetaType) propType;
            MetaType etype = amt.getElementType();
            if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
            {
               CollectionValue avalue = (CollectionValue) prop.getValue();
               if(avalue != null)
               {
View Full Code Here

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

               if(metaType == null)
               {
                  if (managed)
                  {
                     if(type.isArray())
                        metaType = new ArrayMetaType(1, AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
                     else if (Collection.class.isAssignableFrom(type))
                        metaType = new CollectionMetaType(type.getName(), AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE);
                     else
                        metaType = AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE;
                  }
View Full Code Here

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

        metaTypeInstances.put(COMPOSITE_TYPE, compositeMetaType);
        CompositeMetaType mapCompositeMetaType = new MapCompositeMetaType(SimpleMetaType.STRING);
        metaTypeInstances.put(MAP_COMPOSITE_TYPE, mapCompositeMetaType);
        CollectionMetaType collectionMetaType = new CollectionMetaType("ClassName", simpleMetaType);
        metaTypeInstances.put(COLLECTION_TYPE, collectionMetaType);
        ArrayMetaType arrayMetaType = new ArrayMetaType(2, simpleMetaType);
        metaTypeInstances.put(ARRAY_TYPE, arrayMetaType);
        //TableMetaType tableMetaType = new ImmutableTableMetaType("TypeName", "Description", compositeMetaType, new String[]{"Tom", "Dick", "Harry"});
        //metaTypeInstances.put(TABLE_TYPE, tableMetaType);

        return metaTypeInstances;
View Full Code Here

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

               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

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

         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
TOP
Copyright © 2018 www.massapi.com. 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.