Package org.jboss.metatype.api.types

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


         TypeInfo valueType = classInfo.getValueType();
         if(keyType.getName().equals(String.class.getName()))
         {
            // Use MapCompositeMetaType
            MetaType valueMetaType = resolve(valueType);
            return new MapCompositeMetaType(valueMetaType);
         }
         // Map java.util.Properties to MapCompositeMetaType(SimpleMetaType.STRING)
         else if(typeInfo.getName().equals(Properties.class.getName()))
         {
            return new MapCompositeMetaType(SimpleMetaType.STRING);
         }
         // No, return the general map type
         return generateMap(classInfo);
      }
     
View Full Code Here


      if(type instanceof MapCompositeMetaType)
      {
         if((value instanceof Map) == false)
            throw new RuntimeException("Expected Map value for: " + type+", was: "+(value != null ? value.getClass() : "null"));
         Map<String,?> map = (Map) value;
         MapCompositeMetaType mapType = (MapCompositeMetaType) type;
         MetaType mapValueType = mapType.getValueType();
         MapCompositeValueSupport result = new MapCompositeValueSupport(mapValueType);
         for(Entry<String,?> entry : map.entrySet())
         {
            Object entryValue = entry.getValue();
            MetaValue entryMetaValue = internalCreate(entryValue, null, mapValueType);
View Full Code Here

   {
      //Map<String,String> map = new HashMap<String,String>();
      Field field = getClass().getField("compositeSignature");
      Type mapSignature = field.getGenericType();
      CompositeMetaType result = assertInstanceOf(resolve(mapSignature), CompositeMetaType.class);
      MapCompositeMetaType expected = new MapCompositeMetaType(SimpleMetaType.STRING);
     
      testComposite(expected, result);
   }
View Full Code Here

   public void testPropertiesComposite()
      throws Exception
   {
      Type propertiesType = Properties.class;
      CompositeMetaType result = assertInstanceOf(resolve(propertiesType), CompositeMetaType.class);
      MapCompositeMetaType expected = new MapCompositeMetaType(SimpleMetaType.STRING);
      testComposite(expected, result);
   }
View Full Code Here

    */
   public void testMetaMappingComposite()
      throws Exception
   {
      Type type = MetaMappingUsage.class;
      MapCompositeMetaType result = assertInstanceOf(resolve(type), MapCompositeMetaType.class);
      MapCompositeMetaType expected = new MapCompositeMetaType(SimpleMetaType.STRING);
      expected.addItem("name");
      expected.addItem("value");
      expected.addItem("type");
      testComposite(expected, result);
   }
View Full Code Here

   }

   public MapCompositeValueSupport(Map<String, MetaValue> map, MetaType valueType)
   {
      this.map = createMap();
      this.mapType = new MapCompositeMetaType(valueType);
      if(map != null)
      {
         for(Map.Entry<String, MetaValue> entry : map.entrySet())
            this.put(entry.getKey(), entry.getValue());
      }
View Full Code Here

{
   CollectionMetaType type;

   public MCFPropertyMetaDataMapper()
   {
      MapCompositeMetaType etype = new MapCompositeMetaType(SimpleMetaType.STRING);
      etype.addItem("name", "the name of the bean");
      etype.addItem("value", "the string value of the bean");
      etype.addItem("type", "the type name of the value");
      type = new CollectionMetaType("java.util.List", etype);
   }
View Full Code Here

   }

   public MapCompositeValueSupport(Map<String, MetaValue> map, MetaType valueType)
   {
      this.map = createMap();
      this.mapType = new MapCompositeMetaType(valueType);
      if(map != null)
      {
         for(Map.Entry<String, MetaValue> entry : map.entrySet())
            this.put(entry.getKey(), entry.getValue());
      }
View Full Code Here

      if(type instanceof MapCompositeMetaType)
      {
         if((value instanceof Map) == false)
            throw new RuntimeException("Expected Map value for: " + type+", was: "+(value != null ? value.getClass() : "null"));
         Map<String,?> map = (Map) value;
         MapCompositeMetaType mapType = (MapCompositeMetaType) type;
         MetaType mapValueType = mapType.getValueType();
         MapCompositeValueSupport result = new MapCompositeValueSupport(mapValueType);
         for(Entry<String,?> entry : map.entrySet())
         {
            Object entryValue = entry.getValue();
            MetaValue entryMetaValue = internalCreate(entryValue, null, mapValueType);
View Full Code Here

            TypeInfo valueType = types[1];
            if(keyType.getName().equals(String.class.getName()))
            {
               // Use MapCompositeMetaType
               MetaType valueMetaType = resolve(valueType);
               return new MapCompositeMetaType(valueMetaType);
            }
         }
         // Map java.util.Properties to MapCompositeMetaType(SimpleMetaType.STRING)
         else if(typeInfo.getName().equals(Properties.class.getName()))
         {
            return new MapCompositeMetaType(SimpleMetaType.STRING);
         }
         // No, return the general map type
         return generateMap(classInfo);
      }
     
View Full Code Here

TOP

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

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.