Package org.jboss.metatype.api.values

Examples of org.jboss.metatype.api.values.ArrayValue


      if (elementType instanceof TableMetaType || elementType instanceof CompositeMetaType)
      {
         // If this is an ArrayValue check its MetaType
         if (obj instanceof ArrayValue)
         {
            ArrayValue av = (ArrayValue) obj;
            return this.equals(av.getMetaType());
         }
         // Check the element classes
         Class thisClass;
         try
         {
View Full Code Here


      if (elementType instanceof TableMetaType || elementType instanceof CompositeMetaType)
      {
         // If this is an ArrayValue check its MetaType
         if (obj instanceof ArrayValue)
         {
            ArrayValue av = (ArrayValue) obj;
            return this.equals(av.getMetaType());
         }
         // Check the element classes
         Class thisClass;
         try
         {
View Full Code Here

         {
            ArrayMetaType amt = (ArrayMetaType) propType;
            MetaType etype = amt.getElementType();
            if (etype == AbstractManagedObjectFactory.MANAGED_OBJECT_META_TYPE)
            {
               ArrayValue avalue = (ArrayValue) prop.getValue();
               for(int n = 0; n < avalue.getLength(); n ++)
               {
                  GenericValue gv = (GenericValue) avalue.getValue(n);
                  ManagedObject propMO = (ManagedObject) gv.getValue();
                  processManagedObject(propMO, 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();
               MetaValue[] elements = avalue.getElements();
               for(int n = 0; n < avalue.getSize(); n ++)
               {
                  GenericValue gv = (GenericValue) elements[n];
                  ManagedObject propMO = (ManagedObject) gv.getValue();
                  processManagedObject(propMO, md);
               }
View Full Code Here

      if (elementType instanceof TableMetaType || elementType instanceof CompositeMetaType)
      {
         // If this is an ArrayValue check its MetaType
         if (obj instanceof ArrayValue)
         {
            ArrayValue av = (ArrayValue) obj;
            return this.equals(av.getMetaType());
         }
         // Check the element classes
         Class thisClass;
         try
         {
View Full Code Here

         Serializable value = ((GenericValue)metaValue).getValue();
         return getValue(metaType, type, value);
      }
      else if (metaType.isArray())
      {
         ArrayValue arrayValue = (ArrayValue)metaValue;
         if (type == null)
            type= getTypeInfo(metaType, arrayValue.getValue());
         Object array = newArrayInstance(type, arrayValue.getLength());
         for (int i = 0; i < Array.getLength(array); i++)
         {
            Object element = arrayValue.getValue(i);
            if (element instanceof MetaValue)
               element = unwrapMetaValue((MetaValue)element, type, array);
            else if (element != null && element.getClass().isArray())
               element = unwrapArray(array, element);
View Full Code Here

/*     */     }
/* 360 */     if (((this.elementType instanceof TableMetaType)) || ((this.elementType instanceof CompositeMetaType)))
/*     */     {
/* 363 */       if ((obj instanceof ArrayValue))
/*     */       {
/* 365 */         ArrayValue av = (ArrayValue)obj;
/* 366 */         return equals(av.getMetaType());
/*     */       }
/*     */
/* 369 */       Class thisClass = null;
/*     */       try
/*     */       {
View Full Code Here

/*     */       {
/* 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)
/*     */           {
/* 353 */             MetaValue[] elements = avalue.getElements();
/* 354 */             for (int n = 0; n < avalue.getSize(); n++)
/*     */             {
/* 356 */               GenericValue gv = (GenericValue)elements[n];
/* 357 */               ManagedObject propMO = (ManagedObject)gv.getValue();
/* 358 */               if (propMO != null)
/* 359 */                 processManagedObject(propMO, md);
View Full Code Here

/*  539 */       Serializable value = ((GenericValue)metaValue).getValue();
/*  540 */       return getValue(metaType, type, value);
/*      */     }
/*  542 */     if (metaType.isArray())
/*      */     {
/*  544 */       ArrayValue arrayValue = (ArrayValue)metaValue;
/*  545 */       if (type == null)
/*  546 */         type = getTypeInfo(metaType, arrayValue.getValue());
/*  547 */       Object array = newArrayInstance(type, arrayValue.getLength());
/*  548 */       for (int i = 0; i < Array.getLength(array); i++)
/*      */       {
/*  550 */         Object element = arrayValue.getValue(i);
/*  551 */         if ((element instanceof MetaValue))
/*  552 */           element = unwrapMetaValue((MetaValue)element, type, array);
/*  553 */         else if ((element != null) && (element.getClass().isArray())) {
/*  554 */           element = unwrapArray(array, element);
/*      */         }
View Full Code Here

      if (elementType instanceof TableMetaType || elementType instanceof CompositeMetaType)
      {
         // If this is an ArrayValue check its MetaType
         if (obj instanceof ArrayValue)
         {
            ArrayValue av = (ArrayValue) obj;
            return this.equals(av.getMetaType());
         }
         // Check the element classes
         Class thisClass = null;
         try
         {
View Full Code Here

         Serializable value = ((GenericValue)metaValue).getValue();
         return getValue(metaType, type, value);
      }
      else if (metaType.isArray())
      {
         ArrayValue arrayValue = (ArrayValue)metaValue;
         if (type == null)
            type= getTypeInfo(metaType, arrayValue.getValue());
         Object array = newArrayInstance(type, arrayValue.getLength());
         for (int i = 0; i < Array.getLength(array); i++)
         {
            Object element = arrayValue.getValue(i);
            if (element instanceof MetaValue)
               element = unwrapMetaValue((MetaValue)element, type, array);
            else if (element != null && element.getClass().isArray())
               element = unwrapArray(array, element);
View Full Code Here

TOP

Related Classes of org.jboss.metatype.api.values.ArrayValue

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.