Package org.jboss.metatype.api.types

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


      operation.invoke(new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey()));
   }

   public void getValues(MeasurementReport report, Set<MeasurementScheduleRequest> measurementScheduleRequests) throws Exception
   {
      ArrayValueSupport support = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
      SimpleValueSupport[] valueSupports = new SimpleValueSupport[measurementScheduleRequests.size()];
      Iterator<MeasurementScheduleRequest> it = measurementScheduleRequests.iterator();
      for (int i = 0, valueSupportsLength = valueSupports.length; i < valueSupportsLength; i++)
      {
         valueSupports[i] = new SimpleValueSupport(SimpleMetaType.STRING, it.next().getName());
View Full Code Here


      Operation oper = Operation.getOperation(s);
      Collection<PropertySimple> props = configuration.getSimpleProperties().values();
      SimpleValueSupport[] params = new SimpleValueSupport[props.size()];
      SimpleValueSupport[] signature = new SimpleValueSupport[props.size()];
      populateParams(props, params, signature);
      ArrayValueSupport param = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
      param.setValue(params);
      ArrayValueSupport sig = new ArrayValueSupport(new ArrayMetaType(SimpleMetaType.STRING, false));
      sig.setValue(signature);
      SimpleValueSupport queueName = new SimpleValueSupport(SimpleMetaType.STRING, resourceContext.getResourceKey());
      SimpleValueSupport methodName = new SimpleValueSupport(SimpleMetaType.STRING, oper.getOperationName());
      ManagementView view = getProfileService();
      String methodOperation = getInvokeOperation();
View Full Code Here

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

      TypeInfo[] types = typeInfo.getActualTypeArguments();
      if (types != null)
         elementType = types[0];
     
      MetaType elementMetaType = resolve(elementType);
      return new ArrayMetaType(1, elementMetaType);
   }
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

    * @throws Exception for any problem
    */
   @SuppressWarnings("unchecked")
   public void testArrayTypeMetaType() throws Exception
   {
      ArrayMetaType arrayType = new ArrayMetaType(3, SimpleMetaType.STRING);
      assertEquals("[[[Ljava.lang.String;", arrayType.getClassName());
      assertEquals("3-dimension array of java.lang.String", arrayType.getDescription());
      assertEquals("[[[Ljava.lang.String;", arrayType.getTypeName());
      assertTrue("Type should be an array", arrayType.isArray());
   }
View Full Code Here

   }

   @SuppressWarnings("unchecked")
   public void testCharArrayType()
   {
      ArrayMetaType arrayType = ArrayMetaType.getPrimitiveArrayType(char[].class);
      assertEquals("[C", arrayType.getClassName());
      assertEquals("1-dimension array of char", arrayType.getDescription());
      assertEquals("[C", arrayType.getTypeName());
      assertTrue("Type should be an array", arrayType.isArray());
      assertEquals(SimpleMetaType.CHARACTER, arrayType.getElementType());
   }
View Full Code Here

    * @throws Exception for any problem
    */
   @SuppressWarnings("unchecked")
   public void testGetDimension() throws Exception
   {
      ArrayMetaType arrayType = new ArrayMetaType(3, SimpleMetaType.STRING);
      assertEquals("Dimension should be 3", 3, arrayType.getDimension());
   }
View Full Code Here

    * @throws Exception for any problem
    */
   @SuppressWarnings("unchecked")
   public void testElementType() throws Exception
   {
      ArrayMetaType arrayType = new ArrayMetaType(3, SimpleMetaType.STRING);
      assertEquals("Element MetaType should be " + SimpleMetaType.STRING, SimpleMetaType.STRING, arrayType.getElementType());
   }
View Full Code Here

      MockSimpleValue[][] compData1 = new MockSimpleValue[][]
      {
         { sv, null }, { sv, sv }
      };
           
      ArrayMetaType compArrayType1 = new ArrayMetaType(2, SimpleMetaType.STRING);
      assertTrue("compData1 should be a value of array type", compArrayType1.isValue(compData1));

      ArrayMetaType compArrayType2 = new ArrayMetaType(1, SimpleMetaType.STRING);
      assertFalse("compData1 should not be a value of array type, wrong dimension", compArrayType2.isValue(compData1));

      SimpleMetaType simpleType2 = SimpleMetaType.INTEGER;
      ArrayMetaType compArrayType3 = new ArrayMetaType(2, simpleType2);
      assertFalse("compData1 should not be a value of array type, wrong element type", compArrayType3.isValue(compData1));
   }
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.